Date: 2017/7/22
Jiang Luo
Function: Receives a number from the console
Import java.io.*; A package that introduces an IO stream
public class HelloWorld1
{
public static void Main (String args[])
{
try{
Input stream, number received from keyboard
InputStreamReader isr=new InputStreamReader (system.in);
BufferedReader br=new BufferedReader (ISR);
Give a hint
System.out.println ("Please enter the first number");
Reading a row of data from the console
String A1=br.readline ();
System.out.println ("Please enter a second number");
String A2=br.readline ();
Put string-"float"
float NUM1 = float.parsefloat (A1);
float num2 = float.parsefloat (A2);
if (num1>num2)
{
System.out.println ("The first Big One");
}
if (num1==num2)
{
System.out.println ("equal");
}
if (num1<num2)
{
System.out.println ("second Big");
}
}
catch (Exception e) {
E.printstacktrace ();
}
}
}
Java receives a number from the console