- import java.util.Scanner;
- public class Ch01
- {
- public static void main(String[] args)
- {
- Scanner s=new Scanner(System.in);
- int a,b,c,d,e,f,g;
- System.out.print("Enter your four numbers: ");
- a=s.nextInt();
- b=s.nextInt();
- c=s.nextInt();
- d=s.nextInt();
- e=a>b?a:b;
- f=c>d?c:d;
- g=e>f?e:f;
- System.out.println("The biggest number is: "+g);
- }
- }
複製代碼 |