Skip to content

Commit

Permalink
MODIFY FILE(hard code) -> STDOUT
Browse files Browse the repository at this point in the history
  • Loading branch information
remixgrjp committed Feb 23, 2024
1 parent a982157 commit 6f16592
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion run.bat
Expand Up @@ -8,5 +8,5 @@ REM
REM ==
REM
jar cvfm out/Slowcat.jar manifest.txt -C out . lib
java -jar out/Slowcat.jar < starwars.txt
java -jar out/Slowcat.jar
PAUSE
2 changes: 1 addition & 1 deletion run.sh
Expand Up @@ -3,4 +3,4 @@
rm -rf out
javac src/*.java -d out
jar cvfm out/Slowcat.jar manifest.txt -C out . lib
java -jar out/Slowcat.jar < starwars.txt
java -jar out/Slowcat.jar
14 changes: 12 additions & 2 deletions src/Main.java
@@ -1,10 +1,12 @@
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.File;
import java.io.FileReader;

public class Main{
public static void main( String[] args ){
BufferedReader br= new BufferedReader( new InputStreamReader( System.in ) );
BufferedReader br= null;
try{
br= new BufferedReader( new FileReader( new File( "starwars.txt" ) ) );
String s;
while( null != ( s= br.readLine() ) ){
for( int i= 0; i < s.length(); i++ ){
Expand All @@ -15,6 +17,14 @@ public static void main( String[] args ){
}
}catch( Exception e ){//readLine(),sleep()
e.printStackTrace();
}finally{
if( null != br ){
try{
br.close();
}catch( Exception e ){
e.printStackTrace();
}
}
}
}
}

0 comments on commit 6f16592

Please sign in to comment.