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:
Diverse Permutation
Travel Cards
K-Complete Word
Lucky Days
Hongcow Draws a Circle
New Year and Naming
Looksery Party
Jordan Smiley
Optimal Subsequences (Hard Version)
Invertation in Tournament
Finding the largest zero submatrix
Lowest Common Ancestor - Binary Lifting
Digits
Finding articulation points in a graph in $O(N+M)$
Finding the Eulerian path in $O(M)$
Curious Array
Cookie Clicker
Bookshelves
Fibonotci
Gambling Nim
Beautiful Sequence
Molly's Chemicals
The Inclusion-Exclusion Principle
Long Beautiful Integer
Prüfer code
Substitutes in Number
Generate a String
Ehab's REAL Number Theory Problem
Learning and Improving Algorithm through contests - Antti Laaksonen
Party
Dijkstra Algorithm
Divisors