题目链接:
#include#include #define MAXN 1005char a[MAXN],b[MAXN];int len1,len2;int main(){ while(scanf("%s%s",a,b)) { if(a[0]=='0'&&b[0]=='0') break; int i; len1=strlen(a); len2=strlen(b); if(a[0]!='-'&&b[0]=='-') printf("a>b\n"); if(a[0]=='-'&&b[0]!='-') printf("a len2) printf("a b\n"); if(len1==len2) { for(i=0; i b[i]) { printf("a b\n"); break; } } } if(i==len1) printf("a==b\n"); } if(a[0]!='-'&&b[0]!='-')///同为正数 { if(len1>len2) printf("a>b\n"); if(len1 b[i]) { printf("a>b\n"); break; } if(a[i]