Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:有没有用java写的?

Posted by zhblue at 2013-03-22 16:54:40 on Problem 1028
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator