Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void readVotesFileInfo() throws FileNotFoundException {
- Scanner scanner = new Scanner (System.in);
- System.out.println("Qual é o nome do ficheiro?");
- String fileName = scanner.nextLine();
- File f = new File(fileName);
- int nlinhas = 0;
- Scanner fInput = new Scanner(f);
- String[]votes = new String[Main.MAX_DEPUTADOS];
- while (fInput.hasNext() && nlinhas < Main.MAX_DEPUTADOS) {
- String line = fInput.nextLine();
- if (line.length() == 6){
- votes[nlinhas] = line.substring(line.length()-1);
- nlinhas++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement