#include<cstdio> #include<cstring> #include<cmath> using namespace std; int main() { int tc,a,b,dif; char s[10]; scanf("%d",&tc); while (tc--) { scanf("%s",s); a=b=0; for ( int i=0;i<3;i++) a=a*26+s[i]-'A'; for (int i=4;i<8;i++) b=b*10+s[i]-'0'; if (abs(a-b)<101) printf("nice\n"); else printf("not nice\n"); } return 0; }
Sunday, July 17, 2016
UVA 12602 Solution
Unknown
Studying at Shahjalal University of Science and Technology, Sylhet.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment