1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: |
import java.io.*;
class Rei6_1{
public static void main(String[] args) throws IOException{
BufferedReader br = new
BufferedReader(new InputStreamReader(System.in));
System.out.print("点数を入力:");
String str = br.readLine();
int ten = Integer.parseInt(str);
if(ten >= 40){
System.out.println("合格です〜");
}
else{
System.out.println("赤点ですよ・・・");
}
System.out.println("報告終了");
}
}
|

1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: |
import java.io.*;
class Rei6_2{
public static void main(String[] args) throws IOException{
BufferedReader br = new
BufferedReader(new InputStreamReader(System.in));
System.out.print("点数を入力:");
String str = br.readLine();
int ten = Integer.parseInt(str);
if(ten >= 40){
System.out.println("合格です〜");
}
System.out.println("報告終了");
}
}
|
| 演算子 | 使用例 | 説明 |
|---|---|---|
| == | a == b | aとbが同じときtrueを返す |
| != | a != b | aとbが違うときtrueを返す |
| >= | a >= b | aがb以上のときtrueを返す |
| > | a > b | aがbより大きいときtrueを返す |
| <= | a <= b | aがb以下のときtrueを返す |
| < | a < b | aがbより小さいときtrueを返す |