Home > Back-end >  Beginners ball ball you requested
Beginners ball ball you requested

Time:06-10

What I want is to make the input to one hundred, every six in one line, but why didn't the result of the output line breaks

CodePudding user response:

You need to bring the if statement in a for loop

CodePudding user response:

#include
Int main () {
int i;
for(i=1; i<=100; I++) {
Printf (" % d ", I);
If (I % 6==0) {
printf("\n");
}
}
return 0;
}

CodePudding user response:

The judge I % 6 judgment on the loop

CodePudding user response:

Thank you upstairs, the guidance of ah

CodePudding user response:


I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related