编程题,定义一个字符串数组char s[20]={“I am a boy.”},请编程统计该字符串中字母’a’的个数,并显示出来。
查看答案
程序分析题,写出程序的运行结果。#includevoidmain(){int a=34,b=78,newdata;newdata=a/10*1000+b%10*100+b/10*10+a%10;printf("a=%d\tb=%d\tnew=%d\n",a,b,newdata);}
程序分析题,写出程序的运行结果。#includevoidmain(){int x=10,y=20,t=0;if(x==y)t=x;x=y;y=t;printf("%d %d\n",x,y);}
程序分析题,写出程序的运行结果。#includevoidmain(){int i,sum=0;for(i=1;i<=8;i++)sum=sum+i;printf("sum=%d\n",sum);}
程序分析题,写出程序的运行结果。#includevoidmain(){char ch[7]={"65ab21"};int i,s=0;for(i=0;ch[i]>='0'&&ch[i]<='9';i++)s=10*s+ch[i]-'0';printf("%d\n",s);}