|
|
вернуться в форумMy solution :) Послано Scalar 27 янв 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 :) Wow!so cool!!! Re: My solution :) so,cool. help me ! my email:mronoal@163.com thanks! Re: My solution :) 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. |
|
|