-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathABSYS.c
More file actions
38 lines (38 loc) · 825 Bytes
/
ABSYS.c
File metadata and controls
38 lines (38 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include<stdio.h>
int main()
{
long long int t,i,l[3],a[3],j,s;
char x[3][20];
scanf("%lld",&t);
while(t--)
{
scanf("%s",x[0]);
scanf("%s",x[1]);
scanf("%s",x[1]);
scanf("%s",x[2]);
scanf("%s",x[2]);
for(j=0;j<=2;j++)
{
l[j]=strlen(x[j]);
a[j]=0;
for(i=0;i<l[j];i++)
{
if(x[j][i]=='m')
{
s=j;
a[j]=0;
break;
}
else a[j]=(10*a[j])+x[j][i]-'0';
}
}
if(s==0)
a[0]=a[2]-a[1];
else if(s==1)
a[1]=a[2]-a[0];
else if(s==2)
a[2]=a[1]+a[0];
printf("%lld + %lld = %lld\n",a[0],a[1],a[2]);
}
return 0;
}