标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 980 Accepted Submission(s): 452
#include<iostream> #include<stdio.h> #include<math.h> #include<string> #include<string.h> using namespace std; int main() { string s6="4294967296"; string s5="65536"; string s4="256"; string s3="16"; string s2="4"; string s1="2"; string a; while(cin>>a) { if((a.length()==s6.length()&&a>=s6)||(a.length()>s6.length())) { printf("TAT\n"); } else if((a.length()==s5.length()&&a>=s5)||(a.length()>s5.length())){printf("5\n");} else if((a.length()==s4.length()&&a>=s4)||(a.length()>s4.length())){printf("4\n");} else if((a.length()==s3.length()&&a>=s3)||(a.length()>s3.length())){printf("3\n");} else if((a.length()==s2.length()&&a>=s2)||(a.length()>s2.length())){printf("2\n");} else if((a.length()==s1.length()&&a>=s1)||(a.length()>s1.length())){printf("1\n");} else if(a=="1") printf("0\n"); else if(a=="0") printf("TAT\n"); } return 0; }
标签:
原文地址:http://www.cnblogs.com/superxuezhazha/p/5722464.html