ventsislav83

tets number_

May 26th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class numbers {
  4.  
  5.     public static void main(String[] args) {
  6.  
  7.         Scanner scan = new Scanner(System.in);
  8.  
  9.         int num = Integer.parseInt(scan.nextLine());
  10.  
  11.         if (num > 9 && num <= 99) {
  12.  
  13.             if (num % 2 == 0) {
  14.                 System.out.println(num + 7);
  15.             } if (num % 10 == 5) {
  16.                 System.out.println(num + 10);
  17.             }
  18.             if (num % 2 == 0 ||num % 10 == 5 ){
  19.                 System.out.println(num+7+10);
  20.  
  21.             }
  22.         } else {
  23.             System.out.println("error");
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment