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:
Vertical decomposition
Not Wool Sequences
Bathroom terminal
Nastya and Unexpected Guest
Bad Days
Depth First Search
Balanced bracket sequences
Vanya and Field
Rock Is Push
Carrot Cakes
Save the problem
Heroes of Making Magic III
Ehab the Xorcist
Letters Removing
Prince's Problem
Cowslip Collections
Network Configuration
Party
Spectator Riots
E-mail Addresses
Search the subarray with the maximum/minimum sum
Counting Kangaroos is Fun
Boolean Computer
Length of the union of segments
Ramesses and Corner Inversion
Processing Queries
Ants
Kaavi and Magic Spell
Ordering Pizza
Fence Planks
Little Artem and Dance
Graph Decomposition