大家好我試圖通過解決從ACM的一些問題,以提高我的Java技能,現在這東西是我的樣本輸入如下所示:閱讀輸入
3 100
34 100
75 250
27 2147483647
101 304
101 303
-1 -1
所以剛開始我只是想讀他們,但它不是在這裏工作是Java代碼:從文件中讀取它們
import java.io.BufferedInputStream;
import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner stdin = new Scanner(new BufferedInputStream(System.in));
while (stdin.hasNext()) {
System.out.println(stdin.nextInt() + " and the next " + stdin.nextInt());
}
}
}
我想送這些輸入作爲參數,而不是,這裏是如何:
alt text http://i41.tinypic.com/j61npu.gif
該程序只是旋轉(執行)但不打印任何東西。我怎樣才能解決這個問題?