Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- import java.io.*;
- import java.math.*;
- /**
- * Auto-generated code below aims at helping you parse
- * the standard input according to the problem statement.
- **/
- class Solution {
- public static void main(String args[]) {
- Scanner in = new Scanner(System.in);
- int N = in.nextInt();
- String hex = Integer.toHexString(N);
- hex = "" + hex.charAt(hex.length()-1);
- int fact = Integer.parseInt(hex,16);
- N *= fact;
- String last = Integer.toBinaryString(N);
- //
- System.out.println(last.charAt(last.length()-1));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement