|
|
back to boardMy 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 :) 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. |
|
|