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:
Fair
Nikita and stack
Irreducible Anagrams
Image Preview
Binomial Coefficients
Making Shapes
Dexterina’s Lab
Travelling Through the Snow Queen's Kingdom
Fenwick Tree
Aztec Catacombs
Lattice points inside non-lattice polygon
Marbles
Magic Grid
Block Towers
Om Nom and Spiders
Rotate Columns (hard version)
The Great Julya Calendar
Lucky Days
Flowers
New Year and the Factorisation Collaboration
New Year and Hurry
Spy Syndrome 2
Beautiful Bracket Sequence (hard version)
Range Minimum Query
Spectator Riots
Bear and Contribution
Crazy Diamond
More Reclamation
The Holmes Children
Tổng hợp các bài toán duyệt với gợi ý lời giải
Startup Funding
Orac and Game of Life