#include <stdio.h>
#define SQUARE(x) ((x)*(x))
int Squere(int x) {
return (x * x);
}
int main(void) {
int i = 1;
while (i <= 5) {
printf("i=%d,squre=%d\n", i, Squere(i++));
}
int j = 1;
while (j <= 5) {
printf("j=%d,squre=%d\n", j, SQUARE(j++));
}
return 0;
}
运行结果
i=1,squre=1
i=2,squre=4
i=3,squre=9
i=4,squre=16
i=5,squre=25
j=1,squre=2
j=3,squre=12
j=5,squre=30
网友评论