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:
Calculating the determinant of a matrix by Gauss
Voting for Photos
Sharti
Breadth-first search
Interesting Subarray
Substitutes in Number
Long number
Fence Planks
Third Month Insanity
Optimal Subsequences (Easy Version)
Beautiful fountains rows
Finding repetitions
Pumping Stations
Hongcow Masters the Cyclic Shift
Jongmah
Curious Array
Mystic Carvings
Bombs
Counting labeled graphs
Construct the String
Permutation Partitions
New Year and Finding Roots
Aroma's Search
Xenon's Attack on the Gangs
New Year Candles
Composite Coloring
Mischievous Mess Makers
Dungeons and Candies
Bracket Sequence
Invertation in Tournament
Intersecting Subtrees
Little Artem and Random Variable