Search found 1 match

by tonmoy002
Mon Apr 23, 2012 1:33 am
Forum: Volume 100 (10000-10099)
Topic: 10035 - Primary Arithmetic
Replies: 328
Views: 102422

Re: 10035 - Primary Arithmetic

// giving wrong answer .But why???


#include<iostream>
using namespace std;
int main()
{
unsigned int a,b,m1,m2,count,save=0;
while(cin>>a>>b)
{
count=0;
if(a==0&&b==0) break;

while(1)
{
if(a==0&&b==0)
break;
m1=a%10;
m2=b%10;
a=a/10;
b=b/10;
if((m1+m2+save)>9)
{
count++;
save=1 ...

Go to advanced search