import java.io.*;public class ch4_4
{
public static void main(String args[])
{
int people;
int Chinese[]; InputStreamReader stdin = new InputStreamReader(System.in);//键盘输入
BufferedReader bufin = new BufferedReader(stdin);
try
{
people = Integer.parseInt(bufin.readLine());
Chinese=new int[people];
for(int i=0;i<people;i++)
{
Chinese[i]=Integer.parseInt(bufin.readLine());
}
stdin.close();
bufin.close();
}
catch(IOException E)
{
System.out.println("发生I/O错误!!!");
}
}
}
如此输入
{
public static void main(String args[])
{
int people;
int Chinese[]; InputStreamReader stdin = new InputStreamReader(System.in);//键盘输入
BufferedReader bufin = new BufferedReader(stdin);
try
{
people = Integer.parseInt(bufin.readLine());
Chinese=new int[people];
for(int i=0;i<people;i++)
{
Chinese[i]=Integer.parseInt(bufin.readLine());
}
stdin.close();
bufin.close();
}
catch(IOException E)
{
System.out.println("发生I/O错误!!!");
}
}
}
如此输入
解决方案 »
- 谁有javaIO流总结的所有知识呀,就是总结出一个word文档,谁有呀
- 无法打开网页APPLET
- 这里有本J2EE的学习笔记,适合初学者
- 为什么说对象传输于网络必须进行序列化?
- 请看代码,为什么结果是false?
- 问一个原始问题: 我装好j2se后 ,classpth, path 都设好了但还是出错为什么?
- 初学java,简单问题,顺便请推荐java学习电子书!希望交流。
- 用什么方法,可以把一个String型的字符串赋给JTextField对象?谢谢!
- 分特分特!!!!为什么现在的connection refused!!!大虾救命阿;((
- java.awt.event.KeyListener.keyReleased在mac上不起作用
- JTable的问题
- tomcat4.1的连接池如何配置?
当我连续输入1 2时,而不是1回车2回车会出现问题。而我是想连续输入,比如两个数字1 2,将其读入。