Define a one-dimensional array and assign values
int hes[100];
for (int i=0;i<100;i++) {
hes[i]=i+1;
}
Not sure how many times the loop is going to write the loop dead
for (int j=0;j<100,j++) {
int count = number of 0;//is not zero enter the number of loops
int Countzero = number of zeros of 0;//, that is, how many deleted
Filter out to zero (deleted)
if (hes[j]!=0) {
count++;
Count to five, counter reset, corresponding monk for 0 (delete)
if (count==5) {
Count = 0;
hes[j]=0;
}
}else{
countzero++;//Delete the number of counters, there is a flaw, when the cycle is over, can not immediately detect the countzero==96
Only the next cycle can see, wasting computer resources
}
96 deleted, it's time to jump out of a loop.
if (countzero==96) {
Break
}
99, the cycle of a circle, the assignment is zero, then one lap
if (j==99) {
j=0;
}
(I did not install VS, no test, output array I will not help you write, write a little messy, you tidy yourself to write it again)
}
Help a friend write, Lu Zhishen eat steamed bread, not installed VS, not yet pro-test