读入字符串:
BufferReader read = new BufferReader(new InputStreamReader(System.in));
同样你要加上try{}catch{}
BufferReader read = new BufferReader(new InputStreamReader(System.in));
同样你要加上try{}catch{}
解决方案 »
- System.getProperty("prop.custom"); 什么意思?
- 在string中如何实现对某个子母或单词的查找并输出要查找字段的首字母其在整个String中的索引位置?
- 怎么得到桌面的绝对地址!!
- 大家来说说
- spring中这个提示表示什么意思?
- 一个简单的线程问题,好久没做,做了个例子确报错。哪个熟点的,来帮帮我吧``
- 大家请帮忙进进看看,谢谢了!
- @@@@@@@@@@@@@@@@@@@@我是java程序员,也是一个球迷,为中国队加油!!!
- 关于JAVA的简单问题
- 请问,如何在利用JAVA找到某一个文件(只知道文件名)的绝对路径?
- 编写一个应用程序,要求有一个窗口,两个依赖于它的对话框。。用于求圆和三角形面积。。(大家看看是哪错了啊)
- 虚心请教简单问题:java.lang.NullPointerException是如何产生的?应该如何解决?谢谢!
String str;
while((str = read.readLine())!=null){
System.out.println(str);
}
最后记得要关闭流。
read.close()
{
public static void main(String args[])
{
try{
int a = System.in.read();
int b = System.in.read();
System.out.println(Mult(a,b));
}
catch(IOException e)
{}
}
public static int Mult(int M,int N)
{
int R;
if(N ==1)
R = M;
else
R = M + Mult(M,N-1);
return R;
}
}
请问这段程序哪里出问题了?为什么总得不到正确的结果,是不是输入语句有问题,还是函数调用的问题?