Informatika gyűjtemény

Egy szinttel feljebb Main.java

2004050607080910

NézetNyomtat

Main.java (Vissza)
Az alábbi letöltési lehetőségek közül választhatsz: (segítség)
Karakterkódolás:
Sortörés:
Típus: text/plain
Tartalmaz szöveget
Karakterkódolás: us-ascii
Méret: 1 KB
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hu.krivan.szakkor.idegenvezetes;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

/**
 *
 * @author balint
 */
public class Main {

    public Main() throws FileNotFoundException, IOException {
        BufferedReader in = new BufferedReader(new FileReader("input.txt"));
        int nodesCount, edgesCount;
        String[] nodes, edges;
        Graph g;
        while (true) {
            nodesCount = Integer.valueOf(in.readLine());
            if (nodesCount == 0) {
                break;
            }
            nodes = new String[nodesCount];
            for (int i = 0; i < nodesCount; i++) {
                nodes[i] = in.readLine();
            }
            edgesCount = Integer.valueOf(in.readLine());
            edges = new String[edgesCount];
            for (int i = 0; i < edgesCount; i++) {
                edges[i] = in.readLine();
            }

            g = new Graph(nodes, edges);
        }
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws FileNotFoundException, IOException {
        // TODO code application logic here
        new Main();
    }
}
(Vissza)