#include <iostream>
#include <cstring>
using namespace std ;
string num;
int a[110],b[110],c[110];
bool pd ( int len ) {
for ( int i = len ; i >= 1 ; i -- ) if ( b[i]>a[i] ) return true ;
return false ;
}//判断两数大小;
int main ( ) {
cin >> num;
int len1 = num.size();
for ( int i = len1 ; i >= 1 ; i -- ) a[len1-i+1]=num[i-1]-'0';
cin >> num;
int len2 = num.size();
for ( int i = len2 ; i >= 1 ; i -- ) b[len2-i+1]=num[i-1]-'0';
bool pd1 ;
if(len1 < len2) pd1=true ;
if(len1== len2)
if ( pd(len1) )
pd1=true;
if (pd1) {
cout << "-" ;
swap( a , b ) ;
}//判断两数大小,即结果的正负情况;
int n=max(len1,len2);
for ( int i = 1 ; i <= n ; i++ ){
c[i] = a[i] - b[i];
if( c[i] >= 10 ) c[i]-=10,c[i+1]++;
}
while(c[n]==0&&n>1) n-- ;//去零;
for ( int i = n ; i >= 1 ; i-- ) cout << c[i];
}
04-29
7488
04-15
105
11-05
449