| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 160381 | Kevin | 统计字符串 | C++ | Accepted | 0 MS | 268 KB | 434 | 2026-09-17 15:27:57 |
#include<iostream> #include<cstring> using namespace std; int main() { char a[105]; cin.getline(a,105); int len=strlen(a); int yw=0,sz=0,kg=0,ot=0; for(int i=0;i<len;i++){ if((a[i]>='A'&&a[i]<='Z')||(a[i]>='a'&&a[i]<='z')){ yw++; } else if((a[i]>='0'&&a[i]<='9')){ sz++; } else if(a[i]==' '){ kg++; } else{ ot++; } } cout<<yw<<" "<<sz<<" "<<kg<<" "<<ot<<endl; return 0; }