Search found 1 match

by fakeillution
Sat Jul 19, 2014 5:39 pm
Forum: Volume 100 (10000-10099)
Topic: 10035 - Primary Arithmetic
Replies: 328
Views: 101754

Re: 10035 - Primary Arithmetic

please help,why WA?
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
while(1)
{
long long a,b;
cin>>a>>b;
if(a==0 && b==0)break;
if(a<b)swap(a,b);
int carry=0,flag=0,temp;
while(a)
{
if(flag)
temp=(a%10)+(b%10)+1;
else temp=(a%10)+(b%10);
if(temp>=10)
{

if(a ...

Go to advanced search