I'd try to declare i
outside of the loop!
Good luck on solving 3n+1 :-)
Here's an example:
#include <stdio.h>
int main() {
int i;
/* for loop execution */
for (i = 10; i < 20; i++) {
printf("i: %d
", i);
}
return 0;
}
Read more on for loops in C here.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…