2 条题解
-
0
#include<bits/stdc++.h> using namespace std; string s; int a,b,c,d; int main(){ getline(cin,s); for(int i=0;i<s.size();i++){ if(s[i]<='z'&&s[i]>='a'){ a++; } else{ if(s[i]<='Z'&&s[i]>='A'){ b++; } else{ if(s[i]<='9'&&s[i]>='0'){ c++; } else{ if(s[i]==' '){ d++; } else{ cout<<s[i]<<" "; } } } }
} cout<<endl<<"大写:"<<a<<endl<<"小写:"<<b<<endl<<"数字:"<<c<<endl<<"空格:"<<d;
}
信息
- ID
- 1127
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 3
- 标签
- 递交数
- 40
- 已通过
- 12
- 上传者