1. 输入一个字符串,求其中大写字母,小写字母,空格,各有多少?(使

默认分类 未结 1 445
___岁月_如歌_
___岁月_如歌_ 2023-03-19 05:32
1条回答
  • 2023-03-19 05:56

    #include#includeusing namespace std;void main() { char str[256],*p; int a,b,c; a=b=c=0; gets(str); p=str; while ( *p ) { if ( (*p)==' ' ) a++; else if ( ((*p)>='A')&&((*p)<='Z') ) b++; else if ( ((*p)>='a')&&((*p)<='z') ) c++; p++; } cout<<"大写字母"<

    0 讨论(0)
提交回复