1 solutions
-
0
C++ :
#include<stdio.h> #define maxn 105 #include<string.h> char str[maxn]; int main() { // freopen("C.in","r",stdin);//打开文件1.txt用来输入,文件需存在 // freopen("C.out","w",stdout);//打开文件2.txt用来输出,自动创建该文件 while(fgets(str,sizeof(str),stdin)!=NULL){ int len=strlen(str); str[len-1]='\0'; int sum=0; for(int i=0;i<len;i++) if(str[i]>='a'&&str[i]<='z'||str[i]>='A'&&str[i]<='Z') sum++; printf("%d\n",sum); } return 0; }
- 1
Information
- ID
- 18121
- Time
- 1000ms
- Memory
- 64MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By