Paste Search Dynamic
Scanner scanner
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Main
  9. {
  10.         public static void main (string[] args) throws java.lang.exception
  11.         {
  12.         Scanner scanner = new Scanner(system.in);
  13.     system.out.println("名前を入力してください");
  14.     string name = scanner.nextLine ();
  15.     system.out.println("年齢を入力してください");
  16.     int age = scanner.nextInt();
  17.     system.out.println("ようこそ"+age+"才の"+name+"さん");
  18.         }
  19. }
Parsed in 0.017 seconds