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:
Pearls in a Row
New Year Permutation
Valid BFS?
Perfect Encoding
Largest Submatrix 3
Integer factorization
Dice Tower
Au Pont Rouge
Depth First Search
Game on Tree
Arkady and a Nobody-men
Balanced bracket sequences
EKG
Robots on a Grid
Hongcow Builds A Nation
Gotta Go Fast
Mentors
MP3
Train Hard, Win Easy
Restructuring Company
Counting labeled graphs
PE Lesson
Optimal Subsequences (Hard Version)
Friends
Sereja and Algorithm
Gennady and a Card Game
Bots
Photo to Remember
Convex hull trick and Li Chao tree
Tape
Segments on the Line
Perfect Pair