Files
java-question/Question02-Expressions/src/PTra02_01.java
2026-09-11 16:19:51 +09:00

36 lines
1.0 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* PTra02_01.java
* 作成 Rhizome
*------------------------------------------------------------
* Copyright(c) Rhizome Inc. All Rights Reserved.
*/
public class PTra02_01 {
public static void main(String[] args) {
int sum = 6+2;
int diff = 6-2;
int mulch = 6*2;
int div = 6/2;
int rem = 17%5 ;
// TODO 6+2を計算して結果を変数sumに代入してください
// TODO 6-2を計算して結果を変数diffに代入してください
// TODO 6×2を計算して結果を変数mulchに代入してください
// TODO 6÷2を計算して結果を変数divに代入してください
// TODO 17÷5の余りを計算して変数remに代入してください
// 各変数の表示(編集しないでください)
// ※ 8, 4, 12, 3, 2の順で表示されれば正解です
System.out.println("変数sum :" + sum);
System.out.println("変数diff :" + diff);
System.out.println("変数mulch:" + mulch);
System.out.println("変数div :" + div);
System.out.println("変数rem :" + rem);
}
}