forked from vanithaak/first-year-java-practicals
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PrintLines.java
35 lines (30 loc) · 869 Bytes
/
PrintLines.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import java.io.*;
class PrintLines
{
public static void main(String args[])throws IOException
{
int ai;
try(FileInputStream fin = new FileInputStream(args[0]) )
{
do
{
ai=fin.read();
if((char)ai=='/')
{
ai=fin.read();
if((char)ai=='/')
{
do
{
ai=fin.read();
if(ai!=(int)'\n')
{
System.out.print((char)ai);
}
}while((char)ai!='.');
}
}
}while(ai!=-1);
}
}
}