11 2021 档案
摘要:统计字符串中大写字母的个数。 #include<stdio.h> main() { char str[20]; int i,cnt; cnt=i=0; gets(str); while(str[i]!='\0') { if(str[i]>='A'&&str[i]<='Z') cnt++; i++;
阅读全文
摘要:1. #include<stdio.h> main() { double m[8]; int i; for(i=0;i<=7;i++) scanf("%lf",&m[i]); for(i=7;i>=0;i--) printf("%f",m[i]); } 2.使用一维数组,从键盘上接收6个数,找出最大
阅读全文
摘要:猜数字: 随机产生一个0-99的数,猜猜看 如果大了 就提示大了点 如果小了 就提示小了点 直到猜对为止 #include <stdio.h> #include <stdlib.h> #include <time.h> main(){ int x,guess; srand((unsigned int
阅读全文
摘要:1,左直角三角形 #include<stdio.h> main() { int i,j; for(i=1;i<=5;i++){ for(j=1;j<=i;j++){ printf("*"); } printf("\n"); } } 1题倒三角 #include<stdio.h> main() { i
阅读全文
摘要:1.编写程序,使用while语句求和sum=1+3+5+7+…+21。 #include<stdio.h> main() { int i=1;int sum=0; while(i<=21) { sum+=i; i+=2; } printf("sum=%d/n",sum); } 2.编写程序,使用wh
阅读全文
浙公网安备 33010602011771号