import java.util.Scanner;
public class Liti1 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("第一个数");
int a = in.nextInt();
System.out.println("第二个数字");
int b = in.nextInt();
System.out.println("第三个数字");
int c = in.nextInt();
int d = a+b;
if (d>c) {
System.out.println("ture");
}else if (d<c) {
System.out.println("false");
}else if (d == c) {
System.out.println("请不要输入相等数字,不然怀疑你的智商");
}
}
}
java前两个数字和与第三个数字比较基础版
该篇文章介绍了使用Java编写的简单程序,通过Scanner获取用户输入的三个整数,进行加法运算并根据结果进行条件判断输出true、false或提示语。

被折叠的 条评论
为什么被折叠?



