摘要:
1.猜数字:随机产生一个0-99的数,猜猜看,如果大了, 就提示大了点,如果小了,就提示小了点. 直到猜对为止 #include<stdio.h> #include<stdlib.h> #include<time.h> int main(){ time_t ti; int num,guess; sr 阅读全文
posted @ 2021-11-17 23:06
鹤扰
阅读(20)
评论(0)
推荐(0)
摘要:
1.编写程序,使用while语句求和sum=1+3+5+…+21 #include<stdio.h> main() { int i=1,sum=0; while(i<=21) { sum+=i; i+=2; } printf("Sum=%d\n",sum); } 2.编写程序,使用while语句求和 阅读全文
posted @ 2021-11-17 23:05
鹤扰
阅读(27)
评论(0)
推荐(0)
摘要:
使用一维数组,从键盘上接受6个数,找出最大的那个元素并记录下它的下标 #include<stdio.h> main(){ double m[6],max; int i,flag; printf("输入六个数:\n"); for(i=0;i<=5;i++) scanf("%lf",&m[i]); ma 阅读全文
posted @ 2021-11-17 19:01
鹤扰
阅读(28)
评论(0)
推荐(0)

浙公网安备 33010602011771号