Anda di halaman 1dari 3

import java.io.

*;
class add1
{
public static void main(String args[])throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter Three Numbers");
//String s1 = br.readLine();
//String s2 = br.readLine();
//String s3 = br.readLine();
int a,b,c;
a=Integer.parseInt(s1);
b=Integer.parseInt(s2);
c=Integer.parseInt(s3);
if(a>b && b>c)
System.out.println("A is the Frist largest:" +a+ "\nB is the second
largest:"+b+"\nC is the third largest:"+c);
}
else if(a>c && c>b)
{
System.out.println("A is the Frist largest:" +a+ "\nC is the second
largest:" +c+ "\nB is the third largest:"+b);
}

else if(b>a && a>c)


{
System.out.println("B is the Frist largest:" +b+ "\nA is the second largest:" +a+
"\nC is the third largest:"+c);
}
else if(b>c && c>a)
{
System.out.println("B is the Frist largest:" +b+ "\nC is the second largest:" +c+
"\nA is the third largest:"+a);
}
else if(c>a && a>b)
{
System.out.println("C is the Frist largest:" +c+ "\nA is the second largest:" +a+
"\nB is the third largest:"+b);
}
else if (c>b && b>a)
{
System.out.println("C is the Frist largest:" +c+ "\nB is the second largest:" +b+
"\nA is the third largest:"+a );
}
else
{
System.out.println("Inputs are not distinct");

}
}
}

Anda mungkin juga menyukai