Home > Back-end >  The couple, help to see if the problem
The couple, help to see if the problem

Time:10-26

Why I output a bunch of gibberish, but the teacher is 1 1 1, strives for the leaders to help solve my confused

CodePudding user response:

Just want to output 111?
If want to output 111, set the initial value of each for loop is 1, you can refer to the following code:
 
# include & lt; stdio.h>
Int main () {
Int I, j, k;
Print (" I j k ");
For (I=1; i <2; I + +)
For (j=1; J & lt; 2; J + +)
For (k=1; K & lt; 2; K + +)
Printf (" % d % d % d ", I, j, k);
return 0;
}
  • Related