Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 01 / Solutions / task2.cpp
blob: 69e2eb4eecf32988d7438592a19203edf995ad9d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
using namespace std;

int main()
{
	int n;
	cin >> n;
		
	int thirdDigit = n % 10;
	n /= 10; //remove the lastDigit;

	int secondDigit = n % 10;
	n /= 10; //remove the lastDigit;

	int firstDigit = n % 10;

	int reversed = thirdDigit * 100 + secondDigit * 10 + firstDigit;
	reversed++;

	cout << reversed << endl;
}