随笔分类 -  C语言笔记

摘要:#include<stdio.h>#include<stdlib.h>#include<time.h>int main(){ int mum; srand((unsigned int )time(NULL)); int mum1=rand()%101; for(;;) { printf("请输入一个 阅读全文
posted @ 2022-11-06 21:58 向前推进一小时
摘要:#include<stdio.h>#include<time.h>#include<stdlib.h>int main(){ srand((unsigned int)time(NULL)); int number=rand()%10; for(int i=0;i<10;i++) { printf(" 阅读全文
posted @ 2022-11-06 20:19 向前推进一小时
摘要:水仙花数:个、十、百位数立方之和等于数本身 #include<stdio.h>int main(){ int i=100; do{ int a=i%10; int b=i/10%10; int c=i/100; if(a*a*a+b*b*b+c*c*c==i) { printf("%d\n",i); 阅读全文
posted @ 2022-11-06 02:00 向前推进一小时
摘要:#include<stdio.h>int main(){ int i=1; while(i<=100) { if(i%7==0||i%10==7||i/10==7) { printf("敲桌子\n",i); } else { printf("%d\n",i); } i++; } return 0;} 阅读全文
posted @ 2022-11-06 00:52 向前推进一小时
摘要:#include<stdio.h>int main(){ int i=1; while(i<=100) { if(i%2==0) { printf("%d\n",i); } i++; } return 0;} 阅读全文
posted @ 2022-11-06 00:25 向前推进一小时
摘要:int main() { int pig1, pig2, pig3; printf("请输入三只小猪的体重:\n"); scanf("%d%d%d",&pig1, &pig2 ,&pig3); if(pig1>pig2) { if(pig1>pig3) { printf("pig1最重\n"); } 阅读全文
posted @ 2022-11-05 21:22 向前推进一小时