#include<stdio.h> #include<stdlib.h> int main( ) { int i = 0; for (i = 100; i <= 200; i++){ if (i % 2 != 0){ printf(" %d ", i); } } system("pause"); return 0; }
輸出乘法口訣表 ide
#include<stdio.h> #include<stdlib.h> int main() { int m, n,num=0; printf("九九乘法表:\n"); for (m = 1; m <= 9; m++){ for (n = 1; n <= m; n++){ num = m*n; printf(" %d*%d=%d ",n ,m, num); } printf("\n"); } system("pause"); return 0; }
#include<stdio.h> #include<stdlib.h> int main() { int i = 0; for (i = 1000; i <= 2000; i++){ if (i % 4 == 0 || i % 100 != 0 && i % 400 == 0){ printf(" %d ", i); } } system("pause"); return 0; }