-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcode.java
30 lines (25 loc) · 911 Bytes
/
code.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
/*import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class code {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
String file = "C:\\Users\\monica g\\Desktop\\set1-cl.txt";
//String file = "C:\\Users\\monica g\\Desktop\\set2-actor.txt";
BufferedReader br = null;
FileReader fr = null;
fr = new FileReader(file);
br = new BufferedReader(fr);
String line;
int firstCol,secondCol,count=0;
while ((line = br.readLine()) != null) {
String arrayLine[]= line.split("\\s+"); // here you are splitting with whitespace
firstCol = Integer.parseInt(arrayLine[0]);
secondCol=Integer.parseInt(arrayLine[1]);
System.out.println(firstCol+" "+secondCol);
count++;
}
System.out.println(count);
}
}*/