C囂冱由柴哂猟忖銚、腎鯉、方忖才凪万忖憲議方朕
補秘匯佩忖憲?蛍艶由柴竃凪嶄哂猟忖銚、腎鯉、方忖才凪万忖憲議倖方。
殻會蛍裂?旋喘while囂鞘?訳周葎補秘議忖憲音葎'\n'。
旗鷹糞孖?
殻會蛍裂?旋喘while囂鞘?訳周葎補秘議忖憲音葎'\n'。
旗鷹糞孖?
#include <stdio.h>
int main(){
char c; //喘薩補秘議忖憲
int letters=0, // 忖銚方朕
space=0, // 腎鯉方朕
digit=0, // 屁方方朕
others=0; // 凪麿忖憲方朕
printf("補秘匯乂忖憲?");
while((c=getchar())!='\n'){ // 耽肝響函匯倖忖憲?指概扮潤崩
if(c>='a'&&c<='z'||c>='A'&&c<='Z')
letters++;
else if(c==' ')
space++;
else if(c>='0'&&c<='9')
digit++;
else
others++;
}
printf("\n由柴潤惚:\n哂猟忖銚=%d\n腎鯉=%d\n屁方=%d\n凪麿忖憲=%d\n\n", letters, space, digit, others);
return 0;
}
塰佩潤惚?
補秘匯乂忖憲?rwrwewre2345asdJSJQI%^&(& *&sdf YY( 2342-k' 由柴潤惚: 哂猟忖銚=22 腎鯉=5 屁方=8 凪麿忖憲=10