A+B 问题(HDU ACM)
内容贴http://acm.hdu.edu.cn/showproblem.php?pid=1000
#include <iostream>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
int sum=0;
sum=a+b;
cout<<sum<<endl;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
long int sum=0;
sum=a+b;
cout<<sum<<endl;
return 0;
}
#include <iostream>
using namespace std;
int sum(const int &a,const int &b)
{
if((a&b) == 0) return a^b;
else
return sum((a^b),((a&b)<<1));
}
int main()
{
int a,b;
cin>>a>>b;
cout<<sum(a,b)<<endl;
return 0;
}
#include <iostream>
int main()
{
int a,b;
while(std::cin >> a >> b)
{
std::cout << a + b << std::endl;
}
return 0;
}
#include <iostream>
using namespace std;
int main(){
int a, b;
while(cin>>a>>b) cout<<a+b<<endl;
return 0;
}