nhapdulieu_java
import java.io.*;
public class NhapDuLieu
{
static String st;
static DataInputStream str=new DataInputStream(System.in);
static String nhapChuoi()
{
;
try
{
st=str.readLine();
}catch(Exception e)
{
System.out.println("loi");
}
return st;
}
static int nhapSoNguyen()
{
st=nhapChuoi();
int k=0;
try
{
k=Integer.valueOf(st).intValue();
}catch(Exception e)
{
System.out.println("loi");
}
return k;
}
static float nhapSoThucFloat()
{
st=nhapChuoi();
float k=0;
try
{
k=Float.valueOf(st).floatValue();
}catch(Exception e)
{
System.out.println("loi");
}
return k;
}
static double nhapSoThucDouble()
{
st=nhapChuoi();
double k=0;
try
{
k=Double.valueOf(st).doubleValue();
}catch(Exception e)
{
System.out.println("loi");
}
return k;
}
static boolean nhapBoolean()
{
st=nhapChuoi();
boolean i=false;
try
{
i=Boolean.valueOf(st).booleanValue();
}catch(Exception e)
{
System.out.println("loi");
}
return i;
}
}
Bạn đang đọc truyện trên: AzTruyen.Top