1 条题解
-
1
#include<iostream> #include<string> using namespace std; int main() { string a; cin>>a; int b[8]; for(int i=0;i<8;i++) b[i]=0; for(int i=0;i<a.size();i++) { if(a[i]=='1'||a[i]=='Q'||a[i]=='A'||a[i]=='Z') b[0]++; if(a[i]=='2'||a[i]=='W'||a[i]=='S'||a[i]=='X') b[1]++; if(a[i]=='3'||a[i]=='E'||a[i]=='D'||a[i]=='C') b[2]++; if(a[i]=='4'||a[i]=='R'||a[i]=='F'||a[i]=='V') b[3]++; if(a[i]=='5'||a[i]=='T'||a[i]=='G'||a[i]=='B') b[3]++; if(a[i]=='6'||a[i]=='Y'||a[i]=='H'||a[i]=='N') b[4]++; if(a[i]=='7'||a[i]=='U'||a[i]=='J'||a[i]=='M') b[4]++; if(a[i]=='8'||a[i]=='I'||a[i]=='K'||a[i]==',') b[5]++; if(a[i]=='9'||a[i]=='O'||a[i]=='L'||a[i]=='.') b[6]++; if(a[i]=='0'||a[i]=='P'||a[i]==';'||a[i]=='/') b[7]++; if(a[i]=='-'||a[i]=='='||a[i]=='['||a[i]==']'||a[i]=='\'') b[7]++; } for(int i=0;i<8;i++) cout<<b[i]<<endl; }
- 1
信息
- ID
- 2276
- 时间
- 1000ms
- 内存
- 32MiB
- 难度
- 8
- 标签
- 递交数
- 11
- 已通过
- 7
- 上传者