rueki
BOJ 1357. 뒤집힌 덧셈 본문
728x90
반응형
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int Rev(string str)
{
reverse(str.begin(), str.end());
int result = stoi(str);
return result;
}
int main()
{
string a, b;
cin >> a >> b;
int res = Rev(a) + Rev(b);
cout << Rev(to_string(res)) << endl;
return 0;
}
728x90
반응형
'C, C++ 문제풀이' 카테고리의 다른 글
BOJ 1681. 줄 세우기 (0) | 2021.01.01 |
---|---|
BOJ 1427. 소트인사이드 (0) | 2020.12.24 |
BOJ 2908. 상수 (0) | 2020.12.24 |
BOJ 2501.약수 구하기 (0) | 2020.12.22 |
BOJ 5635. 생일 (0) | 2020.12.22 |
Comments