问题 3712 --统计小写字母个数(完善程序)

3712: 统计小写字母个数(完善程序)

时间限制: 1 Sec  内存限制: 128 MB
提交: 372  解决: 315
[提交][状态][命题人:]

题目描述

输入一行字符,中间可能含有空格,长度不超过100

按样例格式输出其中含有的小写字母的个数

#include<iostream>
#include<cstring>
using namespace std;
int main()
{
	char str[105];
    int i=0;
    int count=0;
    gets(str);
    for(_____(1)_____;i<strlen(str);i++,p++)
        if(*p>='a'&&*p<='z') 
            ______(2)_____
    cout<<"It has "<<count<<" lowercases"<<endl;
	return 0;
}

输入

输出

样例输入
Copy
In China, 2020 is not a normal year!
样例输出
Copy
It has 21 lowercases

提示

来源

[提交][状态]