给定区间[-2的31次方, 2的31次方]内的3个整数A、B和C,请判断A+B是否大于C。

package patpractice;

import java.util.ArrayList;
import java.util.Scanner;

import javax.swing.text.StyledEditorKit.BoldAction;

public class practice1 {
public static void main(String[] args) {

ArrayList al = new ArrayList();
for(int count = 1; count<4;count++) {
	System.out.println("请输入第"+count+"个数字");
	Scanner s = new Scanner(System.in);
	int i =s.nextInt();
	al.add(i);
}
Integer case1 = 0;
Integer case2 = 0;
Integer case3 = 0;
case1 = (int) al.get(0);
case2 = (int) al.get(1);
case3 = (int) al.get(2);
if(al.size()==3) {
	System.out.println(case1+case2>case3?"ture":"false");
	
}else {
	System.out.println(false);
}

}
}

你可能感兴趣的:(给定区间[-2的31次方, 2的31次方]内的3个整数A、B和C,请判断A+B是否大于C。)