#include <stdio.h> #include <string.h> int main() { char a[202]={0},b[202]={0}; scanf("%s%s",a,b); int a1[202]={0},b1[202]={0},c1[203]={0},i; int alen=strlen(a),blen=strlen(b); for(i=0;i<alen;i++) { a1[i]=a[alen-1-i]-'0'; } for(i=0;i<blen;i++) { b1[i]=b[blen-1-i]-'0'; } int bigger=1; if(alen==blen) { bigger=strcmp(a,b); } else if(alen<blen) { bigger=-1; } alen=alen>blen?alen:blen; for(i=0;i<alen;i++) { if(bigger>0) { c1[i]=a1[i]-b1[i]; } else { c1[i]=b1[i]-a1[i]; } } for(i=0;i<alen;i++) { c1[i]<0?(c1[i]+=10,c1[i+1]--):c1[i]; } while(!c1[i] && i) { i--; } if(bigger<0) { printf("-"); } for(;i>=0;i--) { printf("%d",c1[i]); } return 0; }