I did what u say,but still getting wa.......
#include<stdio.h>
#include<string.h>
int main()
{
int x,y,z,i,j,k,l;
char a[100],b[100],c;
while(scanf("%s %s",&a,&b)==2 && a[0]!='0' && b[0]!='0')
{
k=0;
l=0;
x=strlen(a);
y=strlen(b);
for(i=x,j=y;j>=0,i>=0;i--,j--)
{
z=(a -48)+(b[j]-48)+l ...
Search found 2 matches
- Wed Sep 05, 2012 9:10 am
- Forum: Volume 100 (10000-10099)
- Topic: 10035 - Primary Arithmetic
- Replies: 328
- Views: 102605
- Wed Aug 29, 2012 1:43 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10035 - Primary Arithmetic
- Replies: 328
- Views: 102605
getting WA for 10035 help me
#include<stdio.h>
#include<string.h>
int main()
{
int x,y,z,i,j,k;
char a[100],b[100],c;
while(scanf("%s %s",&a,&b)==2 && a[0]!='0' && b[0]!='0')
{
k=0;
x=strlen(a);
y=strlen(b);
for(i=x,j=y;i>=0,j>=0;i--,j--)
{
z=(a -48)+(b[j]-48);
if(z>9) k++;
}
if(k==0)
printf("No carry operation.\n ...
#include<string.h>
int main()
{
int x,y,z,i,j,k;
char a[100],b[100],c;
while(scanf("%s %s",&a,&b)==2 && a[0]!='0' && b[0]!='0')
{
k=0;
x=strlen(a);
y=strlen(b);
for(i=x,j=y;i>=0,j>=0;i--,j--)
{
z=(a -48)+(b[j]-48);
if(z>9) k++;
}
if(k==0)
printf("No carry operation.\n ...