#include<iostream>
using namespace std;
void main(void)
{
int integer1[6];
int integer2[6];
int sum1[7] = {0};
int a = 0;
int b = 0;
int c = 0;
cout<<"请输入正负号(1为负,0为正)和5个一位的整数"<<endl;
for (int i = 0; i < 6 ; i++)
{
cin>>integer1[i];
}
cout<<"请输入正负号(1为负,0为正)和5个一位的整数"<<endl;
for (i = 0 ;i <6 ;i++)
{
cin>>integer2[i];
}
a = integer1[5] + integer1[4] * 10 +integer1[3] * 100 +integer1[2] *1000 + integer1[1] * 10000;
b = integer2[5] + integer2[4] * 10 +integer2[3] * 100 +integer2[2] *1000 + integer2[1] * 10000;
if (integer1[0] == 0)
{
if (integer2[0] == 0)
{
c = a + b;
sum1[0] = 0;
}
else
{
if (a > b)
{
c = a - b;
sum1[0] = 0;
}
else
{
c = b - a;
sum1[0] = 1;
}
}
}
else
{
if (integer2[0] == 0)
{
if (a > b)
{
c = a - b;
sum1[0] = 1;
}
else
{
c = b - a;
sum1[0] = 0;
}
}
else
{
c = a + b;
sum1[0] = 1;
}
}
sum1[1] = (int)c/100000;
c = c - sum1[1] * 100000;
sum1[2] = (int)c/10000;
c = c - sum1[2] * 10000;
sum1[3] = (int)c/1000;
c = c - sum1[3] * 1000;
sum1[4] = (int)c/100;
c = c - sum1[4] * 100;
sum1[5] = (int)c/10;
c = c - sum1[5] * 10;
sum1[6] = c;
if (sum1[0] == 0)
{
cout<<'+';
}
else
{
cout<<'-';
}
for (i = 1 ; i < 7; i++ )
{
cout<<sum1[i];
}
cout<<endl;
}