EChebanenko

Untitled

Dec 23rd, 2020
635
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. package HW26Lesson16;
  2.  
  3.  
  4. public class Main extends Logic {
  5.     public static void main(String[] args) {
  6.         try {
  7.             int num1 = getNum();
  8.             int num2 = getNum();
  9.             Methods operation = getOperation();
  10.             int result = result(num1, num2, operation);
  11.             System.out.println("Результат:" + result);
  12.  
  13.         } catch (ArithmeticException e) {
  14.             System.out.println("На ноль делить нельзя!");
  15.         }
  16.     }
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment