Advertisement
AlimusSifar

Game of Fifteen - Toph.co - Beginner

Mar 9th, 2020
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. import java.util.*;
  2. class solution {
  3.     public static void main(String[] args) {
  4.         Scanner sc = new Scanner(System.in);
  5.         String n = sc.nextLine();
  6.         if (n.equals("0")) {
  7.             System.out.println(1);
  8.         }
  9.         else if (n.equals("1")) {
  10.             System.out.println(15);
  11.         }
  12.         else {
  13.             char c = n.charAt(n.length() - 1);
  14.             int a = Character.getNumericValue(c);
  15.             if (a%2 == 0) {
  16.                 System.out.println(25);
  17.             } else {
  18.                 System.out.println(75);
  19.             }
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement