题解 | #kiki算数#
kiki算数
https://www.nowcoder.com/practice/bcaf710fb58a44e1b678a890e6e90d7c
#include <stdio.h>
int main()
{
int a,b;
scanf("%d %d",&a,&b);
int a1,a2,b1,b2;
a1=a%10;
a2=a/10%10;
b1=b%10;
b2=b/10%10;
int m,n;
m=(a1+b1)%10;
n=(a2+b2)+(a1+b1)/10;
if(n%10==0)
{
printf("%d",m);
}
else
{
n=n%10;
printf("%d%d",n,m);
}
return 0;
}
int main()
{
int a,b;
scanf("%d %d",&a,&b);
int a1,a2,b1,b2;
a1=a%10;
a2=a/10%10;
b1=b%10;
b2=b/10%10;
int m,n;
m=(a1+b1)%10;
n=(a2+b2)+(a1+b1)/10;
if(n%10==0)
{
printf("%d",m);
}
else
{
n=n%10;
printf("%d%d",n,m);
}
return 0;
}