#include<cstdio> #include<cstring> using namespace std; int main() { int tc,c=1; scanf("%d",&tc); getchar(); while (tc--) { char s[1000]; gets(s); int l=strlen(s); int sum=0; for (int i=0;i<l;i++) switch(s[i]) { case 'b': case 'e': case 'h': case 'k': case 'n': case 'q': case 'u': case 'x': sum+=2; break; case 'c': case 'f': case 'i': case 'l': case 'o': case 'r': case 'v': case 'y': sum+=3; break; case 's': case 'z': sum+=4; break; default : sum+=1; break; } printf("Case #%d: %d\n",c++,sum); } return 0; }
Tuesday, July 19, 2016
UVA 11530 Solution
Unknown
Studying at Shahjalal University of Science and Technology, Sylhet.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment