Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
11960 徐一喆 字符统计 C++ Accepted 2 MS 748 KB 332 2021-05-18 16:23:31

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main() { string a; int b=0,c=0,d=0,e=0; getline(cin,a); for(int i=0;i<a.size();++i) { if(a[i]==' ') e++; else if(a[i]>='A'&&a[i]<='Z') ++b; else if(a[i]>='a'&&a[i]<='z') c++; else d++; } cout<<b<<" "<<c<<" "<<d<<" "<<e<<endl; return 0; }