Az alábbi letöltési lehetőségek közül választhatsz: (
segítség)
Típus: text/plain
Tartalmaz szöveget
Karakterkódolás: utf-8
Méret: 894 byte
package hu.krivan.szakkor.szerkezetek;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
@author
public class Main {
private static final String MAGIC_STRING = "impossible";
@param
public static void main(String[] args) throws FileNotFoundException, IOException {
PrintWriter out = new PrintWriter( new BufferedWriter( new FileWriter("myOutput.txt") ) );
Graf graf;
while( (graf = GrafFactory.getNextGraf()) != null )
{
int height = graf.maxHeightIfHung();
if( height == -1 ) {
out.println( MAGIC_STRING );
} else {
out.println( height );
}
}
out.close();
}
}