eclipse - What's the problem with this code in Java? -


I want to create a program in Java in Eclipse, what I have to say, if I can do triangle or not it's mine The code is:

  import java.io.IOException; Public class haromszog {public static zero main throws (string [] args) IOException throws {int a; Int b; Int c; System.out.print ("Insert the 'A' side of the triangle:"); A = System.in.read (); System.out.print ("Insert the 'B' side of the triangle:"); B = System.in.read (); System.out.print ("Insert the 'C' side of the triangle:"); C = System.in.read (); If ((a + b)> c) {if ((a + c)> b) {if ((b + c)> a) {System.out.print ("You make this triangle Can "); } Else System.out.print ("You can not make this triangle"); Eclipse can run, but it writes:  

Please include the 'A' part of the triangle : (For example, I write :) 5

Please include the 'B' side of the triangle:

Please include the 'C' side of the triangle:

You can not create this triangle

And I can not write anything on the B and C side. What's the problem with it?

A single byte reads the standard input from your application. almost certainly is not what you want (unless some binary data is present in your application).

You can try instead (as a result for string a int ).

Comments