1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
#include<iostream> #include<cstdio> #include<cstring> using namespace std; int main(){ int ans=0; char s[5]; gets(s); int lengths=strlen(s); for(int i=0;i<lengths;i++){ if(s[i]>='a' && s[i]<='z'){ ans++; } if(s[i]>='A' && s[i]<='Z'){ ans++; } if(s[i]>='0' && s[i]<='9'){ ans++; } } cout<<ans<<endl; return 0; }
|