//Ist method
import java.io.BufferedReader;
import java.io.InputStreamReader;
class input
{
public static void main(String args[])
{
try
{
BufferedReader br =
new BufferedReader(new InputStreamReader(System.in));
String s = br.readLine();
double number = Double.parseDouble(s);
System.out.println("Number is:" + number);
} catch (Exception e) { System.err.println("Error:" + e.getMessage());}
}
}
//IInd Method
class input
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
while(sc.hasNextLine())
{
String line = sc.nextLine();
double number = Double.parseDouble(line);
System.out.println("Number is: " + number);
}
}
}
No comments:
Post a Comment