アットウィキロゴ

ouchi > Practice > Enshu02-22_Driver

  1. import java.util.Scanner;
  2.  
  3. public class Driver {
  4.  
  5. public static void main(String[] args) {
  6.  
  7. Scanner scan = new Scanner(System.in);
  8.  
  9. System.out.println("割られる数を入力してください");
  10. int x = scan.nextInt();
  11. System.out.println("割る数を入力してください");
  12. int y = scan.nextInt();
  13.  
  14. try {
  15. int result = Calculator.divide(x, y);
  16. System.out.println("結果: " + result);
  17. } catch (IllegalInputException e) {
  18. e.printStackTrace();
  19. }
  20.  
  21. }
  22.  
  23. }
  24.  
最終更新:2013年05月17日 14:42