-2
我是Java的初学者。我写这段代码在CMD上进行编译。多行的标准输入
public class AA {
public static void main (String[] args){
int line=Integer.parseInt(args[0]);
int i=0;
while(i<line){
double first_input = StdIn.readDouble();
double second_input = StdIn.readDouble();
double third_input = StdIn.readDouble();
double average = first_input * 0.2 + second_input * 0.4 + third_input * 0.4;
line-=1
StdOut.println(average+"is..");
}
}
}
虽然我在寻找这样的:
2 15 22
2 5 77
15,2 is...
33,2 is...
我得到的输出仅仅是这样的:
2 15 22
15,2 is...
2 5 77
33,2 is...
我尝试过很多方法,但我没有得到解决。有一些我看不到的技巧吗?