摘要:#include <stdio.h>#include <stdlib.h>#include <time.h> int main(){ int x = 0; srand((unsigned)time(NULL)); x = rand() %10; printf("产生的随机数是:%d \n", x);
阅读全文
摘要:#include <stdio.h>#include <stdlib.h> int main(){ int i=0; for (i = 1; i <= 10; i++) { if (i == 3) { break; } printf("%d\n", i); } printf(" \n"); int
阅读全文
摘要:#include <stdio.h>#include <stdlib.h> int main(){ int i, j; for (i = 1; i <= 9; i++) { for (j = 1; j <= i; j++) { printf("%d*%d=%d ", i, j, i * j); }
阅读全文
摘要:#include <stdio.h>#include <stdlib.h> int main(){ int x = 10; goto END; x == 20;END: printf("x的值是:%d \n", x); system("pause"); return 0;}
阅读全文
摘要:#include <stdio.h>#include <stdlib.h> int main(){ int x = 4; int y = x > 10 ? 100 : 2000; printf("y的值是:%d。\n", y); system("pause"); return 0;}
阅读全文
摘要:#include <stdio.h>#include <stdlib.h> int main(){ for (int x = 0; x < 10; x++) { printf("第%d次循环。 \n", x); } system("pause"); return 0;}
阅读全文
摘要:#include <stdio.h> #include <stdlib.h> int main() { int x=0; do{ x++; printf("第%d次循环。",x); }while(x<10); system("pause"); return 0; }
阅读全文
摘要:#include <stdio.h> #include <stdlib.h> int main() { int x=0; while(x<10){ printf("第%d次循环。 \n",x); x++; } system("pause"); return 0; }
阅读全文
摘要:#include <stdio.h> #include <stdlib.h> int main() { int x=2; switch(x){ case 1: printf("x的值是1"); break; case 2: printf("x的值是2"); break; case 3: printf
阅读全文
摘要:#include <stdio.h> #include <stdlib.h> int main() { int x=12; if(x>10){ printf("x的值大于10 \n"); }else if(x<10){ printf("x的值小于10\n"); } system("pause");
阅读全文