61A:Ultra Fast Mathematician

Problem Link

Hints:

* The length of each number doesn’t exceed 100.

It  means the length might be under 100 or might be 99


<Source code>

#include<stdio.h>
#include<string.h>

char a[10000],b[10000];int sum[10000];
int main()
{
long long l,i,t,n,l1,l2;
scanf(“%s %s”,a,b);
l1=strlen(a);
l2=strlen(b);l=l1;
if(l1!=l2)
return 0;
else{
for(i=0;i<l;i++)
{sum[i]=(a[i]-‘0’)+(b[i]-‘0’);

if((a[i]-‘0’)+(b[i]-‘0’)==2)
sum[i]=0;

printf(“%d”,sum[i]);
}
}

return 0;
}

Advertisements

About waprogramming

I am in CSE,from CUET
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s