import java.util.Scanner; void main() { Scanner sc = new Scanner(System.in); int i = sc.nextInt(); // 他に nextDouble, nextLine, next など System.out.printf(" %d の 2乗は %d です。%n", i, i * i); sc.close(); }