Input
The only line of the input contains a 7-digit hexadecimal number. The first “digit” of the number is letter A, the rest of the “digits” are decimal digits 0-9.Output
Output a single integer.Examplesinput
A278832
output
0
input
A089956
output
0
input
A089957
output
1
input
A144045
output
1
Solution:
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
string s;
cin >> s;
cout << (s.back() % 2) << '\n';
return 0;
}
Related posts:
Special Task
Restoring Three Numbers
Breaking Good
Eevee
Chat Order
Marvolo Gaunt's Ring
Dima and Staircase
Hongcow's Game
Extended Euclidean Algorithm
Connected Components
Vanya and Cubes
Challenges in school №41
Good Subsets
Curious Array
Ilya and a Colorful Walk
Bash's Big Day
The Holmes Children
May Holidays
Captains Mode
Satanic Panic
Degenerate Matrix
A + B Strikes Back
Load Testing
Kind Anton
Watchmen
Pudding Monsters
Dreamoon Likes Strings
Little Artem and Grasshopper
Dream Team
Minimum Euler Cycle
Hongcow Draws a Circle
Make It One