Search
Latest topics
Nhập dữ liệu từ bàn phím trong Java
Nhập dữ liệu từ bàn phím trong Java
import java.io.*;
import java.util.*;
class MyInput
{
public static int ReadInt()
{
int i=0;
InputStreamReader isr=New InputStreamReader(System.in);
BufferedReader bs=new BufferedReader(isr);
try
{
String s=br.readLine();
i=new Integer(s).intValue();
}
catch(IOException ex)
{
System.out.println(ex);
}
return i;
}
}
class TestMyInput
{
public static void main(String args[])
{
int x;
System.out.print("Nhap x = ");
x=MyInput.ReadInt();
System.out.println("Gia tri x = "+x);
}
import java.util.*;
class MyInput
{
public static int ReadInt()
{
int i=0;
InputStreamReader isr=New InputStreamReader(System.in);
BufferedReader bs=new BufferedReader(isr);
try
{
String s=br.readLine();
i=new Integer(s).intValue();
}
catch(IOException ex)
{
System.out.println(ex);
}
return i;
}
}
class TestMyInput
{
public static void main(String args[])
{
int x;
System.out.print("Nhap x = ");
x=MyInput.ReadInt();
System.out.println("Gia tri x = "+x);
}
Similar topics
» Đọc dữ liệu từ file excel trong Java
» TÍCH CÁC SỐ NGUYÊN TỐ TRONG N SỐ NGUYÊN NHẬP TỪ BÀN PHÍM
» Mảng trong ngôn ngữ lập trình java
» Các bước cơ bản để đột nhập trong LAN
» phím tắt thường dùng trong Linux
» TÍCH CÁC SỐ NGUYÊN TỐ TRONG N SỐ NGUYÊN NHẬP TỪ BÀN PHÍM
» Mảng trong ngôn ngữ lập trình java
» Các bước cơ bản để đột nhập trong LAN
» phím tắt thường dùng trong Linux
Permissions in this forum:
You cannot reply to topics in this forum
Thu Aug 23, 2012 5:38 am by Admin
» Tuyệt kỹ cua giai
Thu Aug 23, 2012 5:36 am by Admin
» NETCAT.........
Mon Aug 13, 2012 6:35 am by Admin
» Bảo mật CSDL bằng phương pháp mã hóa.
Tue Apr 17, 2012 10:04 pm by Admin
» Hàm mã hóa MD5 bằng JavaScript
Tue Apr 17, 2012 10:03 pm by Admin
» Giá của món quà
Fri Apr 13, 2012 6:01 am by Admin
» Sẽ chỉ yêu ai?
Fri Apr 13, 2012 6:01 am by Admin
» Cách đọc bảng chữ cái!
Thu Apr 12, 2012 10:37 pm by Admin
» Gắn trojan, keylog, virus vào website, forum
Tue Apr 10, 2012 1:14 am by Admin