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:
Gauss method for solving system of linear equations
Cinema
Magic Grid
Degenerate Matrix
Noise Level
New Year and Cake
Niyaz and Small Degrees
Idempotent functions
Function
Big Problems for Organizers
Xor-Set
Mischievous Mess Makers
Optimal schedule of jobs given their deadlines and durations
Binary Exponentiation
Students Initiation
Unusual Graph
PolandBall and Gifts
Worms
Distinct Paths
NP-Hard Problem
Search for a pair of intersecting segments
Calculating the determinant of a matrix by Gauss
4-point polyline
Mind Control
Prefix-Suffix Palindrome (Hard version)
Teams
The Chocolate Spree
Dynamic Programming on Broken Profile
Dexterina’s Lab
Oriented area of a triangle
Old Peykan
University Classes