標準入出力・データ型 解答例

練習問題1-1

System.out.print("Hello World")

練習問題1-2


Scanner scanner = new Scanner(System.in);
String A = scanner.nextLine();
System.out.println(A);
scanner.close();

練習問題1-3


double B = 10.5;
int A = (int) B;

練習問題1-4


char B = 'B';
double A = B;

練習問題1-5


char A = 'C';
System.out.print((int) A);