#include <stdio.h>
int m(int x)
{
int s=0;
for(;x>0;)
s=s+x%10;
x=x/10;
}
return s;
int main()
int i,j,k,r;
scanf("%d%d%d",&i,&j,&k);
r=m(i)+m(j)+m(k);
printf("%d",r);
return 0;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
#include <stdio.h>
int m(int x)
{
int s=0;
for(;x>0;)
{
s=s+x%10;
x=x/10;
}
return s;
}
int main()
{
int i,j,k,r;
scanf("%d%d%d",&i,&j,&k);
r=m(i)+m(j)+m(k);
printf("%d",r);
return 0;
}