fork download
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5. public static void main(String[] args) {
  6. Scanner scanner = new Scanner(System.in);
  7. System.out.print("nomer?");
  8. int n1 = scanner.nextInt();
  9.  
  10. System.out.print("nomer??");
  11. int n2 = scanner.nextInt();
  12.  
  13. int n3;
  14.  
  15. System.out.print("znak?");
  16. String action = scanner.nextLine();
  17. action = scanner.nextLine();
  18.  
  19. switch(action){
  20. case "+":
  21. n3 = n1+n2;
  22. System.out.print(n3);
  23. break;
  24. case "-":
  25. n3 = n1-n2;
  26. System.out.print(n3);
  27. break;
  28. case "*":
  29. n3 = n1*n2;
  30. System.out.print(n3);
  31. break;
  32. case "/":
  33. n3 = n1/n2;
  34. System.out.print(n3);
  35. break;
  36. }
  37.  
  38.  
  39. }
  40. }
  41.  
  42.  
Success #stdin #stdout 0.16s 56700KB
stdin
100
5
/
stdout
nomer?nomer??znak?20