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:
Earth Wind and Fire
Hongcow Buys a Deck of Cards
Prefix Enlightenment
Magnum Opus
Dream Team
Enduring Exodus
15 Puzzle Game: Existence Of The Solution
Om Nom and Candies
Lingua Romana
Long Beautiful Integer
Length of the union of segments
Cow and Vacation
Pie Rules
Matching vs Independent Set
Optimal Subsequences (Hard Version)
Finding the Eulerian path in $O(M)$
Dome
Optimal schedule of jobs given their deadlines and durations
Transmitting Levels
Kuroni and the Score Distribution
Letters Removing
Sherlock and the Encrypted Data
Minus and Minus Give Plus
Welfare State
New Year and the Treasure Geolocation
Professor GukiZ's Robot
Egg Roulette
Parliament of Berland
Wrong Answer on Test 233 (Easy Version)
Rooks and Rectangles
Mind Control
Not Wool Sequences