11 2021 档案
摘要:1.编写程序,统计字符串中大写字母的个数 #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++
阅读全文
摘要:1.定义一个含有8个储存单元的实型数组,从键盘山接收数,然后逆序输出 #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",
阅读全文
摘要:1. * ** *** **** ***** #include<stdio.h> main() { int i,j; for(i=1;i<=5;i++){ for(j=1;j<=i;j++){ printf("*"); } printf("\n"); } ******* ***** *** * #i
阅读全文
摘要:1.编写程序,使用while语句求和sum=1+3+5+7+…+21. #include<stdio.h> main() { int a=1,sum=0; while(a<=21) { sum+=a; a+=2; } printf("sum=%d\n",sum); } 2.编写程序,使用while语
阅读全文
摘要:1.编写程序,使用scanf()函数接收整形、实型、字符型的变量,并分行依次输出 #include<stdio.h> main() { int a; float b; char c; scanf("%d%f%c",&a,&b,&c); printf("%d\n%f\n%c\n",a,b,c); }
阅读全文

浙公网安备 33010602011771号