add1.java

download add1.java

of 3

Transcript of add1.java

  • 8/18/2019 add1.java

    1/3

    import java.io.*;

    class add1

    {

      public static void main(String args[])throws IOException

      {

     Buered!eader br"new Buered!eader(new InputStream!eader(S#stem$in))%

    S#stem$out$println(&Enter Three Numbers&)%

    ''String s " br$readine()%

    ''String s* " br$readine()%

    ''String s+ " br$readine()%

    int a,b,c%

    a"Integer$parseInt(s)%

     b"Integer$parseInt(s*)%

    c"Integer$parseInt(s+)%

      i(a-b .. b-c)

      S#stem$out$println(&/ is the 0rist largest1& 2a2 &3nB is the secondlargest1&2b2&3n4 is the third largest1&2c)%

      5

    else i(a-c .. c-b)

      {

      S#stem$out$println(&/ is the 0rist largest1& 2a2 &3n4 is the second

    largest1& 2c2 &3nB is the third largest1&2b)%

      5

  • 8/18/2019 add1.java

    2/3

    else i(b-a .. a-c)

      {

    S#stem$out$println(&B is the 0rist largest1& 2b2 &3n/ is the second largest1& 2a2

    &3n4 is the third largest1&2c)%

      5

    else i(b-c .. c-a)

      {

    S#stem$out$println(&B is the 0rist largest1& 2b2 &3n4 is the second largest1& 2c2

    &3n/ is the third largest1&2a)%

      5

    else i(c-a .. a-b)

      {

    S#stem$out$println(&4 is the 0rist largest1& 2c2 &3n/ is the second largest1& 2a2

    &3nB is the third largest1&2b)%

      5

    else i (c-b .. b-a)

    {

    S#stem$out$println(&4 is the 0rist largest1& 2c2 &3nB is the second largest1& 2b2

    &3n/ is the third largest1&2a )%

      5

    else

      {

    S#stem$out$println(&Inputs are not distinct&)%

  • 8/18/2019 add1.java

    3/3

      5

      5

    5