Skip to content

Commit cf83fc3

Browse files
committed
add ContestIO(File)
1 parent c0c653f commit cf83fc3

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

ContestIO/ContestPrinter.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ class ContestPrinter extends java.io.PrintWriter{
22
public ContestPrinter(java.io.PrintStream stream){
33
super(stream);
44
}
5+
public ContestPrinter(java.io.File file) throws java.io.FileNotFoundException{
6+
super(new java.io.PrintStream(file));
7+
}
58
public ContestPrinter(){
69
super(System.out);
710
}

ContestIO/ContestScanner.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ class ContestScanner {
1111
public ContestScanner(java.io.InputStream in){
1212
this.in = in;
1313
}
14+
public ContestScanner(java.io.File file) throws java.io.FileNotFoundException {
15+
this(new java.io.BufferedInputStream(new java.io.FileInputStream(file)));
16+
}
1417
public ContestScanner(){
1518
this(System.in);
1619
}

0 commit comments

Comments
 (0)