ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1000. A+B Problem

My solution :)
Posted by Scalar 27 Jan 2011 20:02
int sum(int a,int b)
{
    if(a==0)return b;
    if(b==0)return a;
    return sum((a&b)<<1,a^b);
}
Re: My solution :)
Posted by lql1993 17 Apr 2011 12:44
Wow!so cool!!!
Re: My solution :)
Posted by Mronoal 9 Sep 2011 12:05
so,cool. help me !
my email:mronoal@163.com
thanks!
Re: My solution :)
Posted by shoxrux 20 Oct 2011 19:18
oooo  it's very  task.
But does not work.
Why?


-------------------

#include<iostream>
using namespace std;
int main()
{
int a,b;

cout<<"a=";cin>>a;
cout<<"b=";cin>>b;
cout<<a+b<<endl;
system("pause");
}




Why it's have a mistakes
Re: My solution :)
Because you were asked to output only the sum of A and B, and NOT "a=" and "b=". A good thing is to read FAQ before starting to solve problems.