主题:关于JAVA变量的键盘输入-新手必看
希望此贴对新手有帮助!
import java.io.*;
public class input{
public static void main(String[] args) throws IOException{
System.out.print("第一个数:");
BufferedReader a=new BufferedReader(new InputStreamReader(System.in));
int num1=Integer.parseInt(a.readLine());
System.out.print("第二个数:");
BufferedReader b=new BufferedReader(new InputStreamReader(System.in));
int num2=Integer.parseInt(b.readLine());
System.out.print("第三个数:");
BufferedReader c=new BufferedReader(new InputStreamReader(System.in));
int num3=Integer.parseInt(c.readLine());
if(num1>num2 && num1>num3)System.out.println("大数是:"+num1);
else if(num2>num3 && num2>num1)System.out.println("大数是:"+num2);
else if(num3>num2 && num3>num1)System.out.println("大数是:"+num3);
}
}
import java.io.*;
public class input{
public static void main(String[] args) throws IOException{
System.out.print("第一个数:");
BufferedReader a=new BufferedReader(new InputStreamReader(System.in));
int num1=Integer.parseInt(a.readLine());
System.out.print("第二个数:");
BufferedReader b=new BufferedReader(new InputStreamReader(System.in));
int num2=Integer.parseInt(b.readLine());
System.out.print("第三个数:");
BufferedReader c=new BufferedReader(new InputStreamReader(System.in));
int num3=Integer.parseInt(c.readLine());
if(num1>num2 && num1>num3)System.out.println("大数是:"+num1);
else if(num2>num3 && num2>num1)System.out.println("大数是:"+num2);
else if(num3>num2 && num3>num1)System.out.println("大数是:"+num3);
}
}