Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) throws Exception
- {
- @SuppressWarnings("resource")
- Scanner inFile = new Scanner(new File("file.txt"));
- // Read the number of vertices
- String line = inFile.nextLine();
- String[] data=line.split(",|\\s+");
- int part1=Integer.parseInt(data[0]);
- int part2=Integer.parseInt(data[1]);
- while(inFile.hasNext())
- {
- line=inFile.nextLine();
- int index =0;
- int count=0;
- char edges = ',';
- while(index<line.length()) {
- if(line.charAt(index)==edges){
- count++;
- }
- index++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement