Http://acm.nyist.net/JudgeOnline/problem.php? PID = 73
High Precision Problems
#include <iostream>#include <string.h>using namespace std;int main(){char a[1010],b[1010],ans[1000];while(cin>>a>>b){memset(ans,0,sizeof(ans));if(a[0]=='0'&&b[0]=='0') break;int len_a=strlen(a);int len_b=strlen(b);if(a[0]=='-'&&b[0]!='-'){cout<<"a<b"<<endl;}else if(a[0]!='-'&&b[0]=='-'){cout<<"a>b"<<endl;}else if(a[0]=='-'&&b[0]=='-'){if(len_a>len_b)cout<<"a<b"<<endl;else if(len_a<len_b)cout<<"a>b"<<endl;else {for(int i=1;i<len_a;i++){if(a[i]>b[i]){cout<<"a<b"<<endl;break;}else if(a[i]<b[i]){cout<<"a>b"<<endl;break;}if(i==len_a-1) cout<<"a==b"<<endl;}}}else if(a[0]!='-'&&b[0]!='-'){if(len_a>len_b)cout<<"a>b"<<endl;else if(len_a<len_b)cout<<"a<b"<<endl;else {for(int i=0;i<len_a;i++){if(a[i]>b[i]){cout<<"a>b"<<endl;break;}else if(a[i]<b[i]){cout<<"a<b"<<endl;break;}if(i==len_a-1) cout<<"a==b"<<endl;}}}}return 0;}