| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:有没有用java写的?In Reply To:有没有用java写的? Posted by:white320 at 2013-03-22 16:24:09 > 用java写每次用到这Scanner cin = new Scanner(System.in)
> 测试的时候不知道怎么往进传参呀,求指教。
> 或者谁有其他方法亦可。
import java.util.*;
import java.io.*;
public class Main{
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = null;
try {
in = new Scanner(new FileInputStream("in.txt"));
} catch (Exception e) {
in = new Scanner(System.in);
}
while (in.hasNext()) {
......
}
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator