妳太懶了.嘿嘿
第壹題,看圖片
第二題:
n?n/10
第三題:
#include?<stdio.h>
#include?<string.h>
int?main()
{
char?strInput[255];
int?i=0;
int?nLength,nLow,nUpp;nLength=0;nLow=0;nUpp=0;
scanf("%s",strInput);
nLength=strlen(strInput);
printf("所有字符數:%d\n",nLength);
do{
char?sTemp=strInput[i];
if?(sTemp>=97?&&?sTemp<=122)
nLow++;
if?(sTemp>=65?&&?sTemp<=90)
nUpp++;
i++;
}?while?(i<nLength);
printf("小寫字母數:%d\n",nLow);
printf("大寫字母數:%d\n",nUpp);
return?0;
}
第四題:
#include<stdio.h>
int?main()
{
int?p[10]; int?i,ave,sum=0,t=0,flag=0; for(i=0;i<10;i++) { scanf("%d",&p[i]); sum+=p[i]; if(p[i]>=60)?t++; } ave=sum/10;for(i=0;i<10;i++)
if(p[i]>ave)?flag++; printf("平均成績:%d\n及格人數:%d\n高於平均分人數:%d\n",ave,t,flag); return?0;}
樓主這可都是我辛辛苦苦自己做的哦!