Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.util.ArrayList;
- import java.util.Scanner;
- class Ocena {
- double nota;
- Ocena(double x) {
- nota = x;
- }
- }
- class skok {
- double dlugosc;
- Ocena[] oceny;
- skok(double dl, double x1, double x2, double x3, double x4, double x5) {
- dlugosc = dl;
- oceny[0] = new Ocena(x1);
- oceny[1] = new Ocena(x2);
- oceny[2] = new Ocena(x3);
- oceny[3] = new Ocena(x4);
- oceny[4] = new Ocena(x5);
- }
- }
- class Zawodnik {
- String nazwisko;
- ArrayList<skok> skoki;
- Zawodnik(String naz) {
- nazwisko = naz;
- skoki = new ArrayList<skok>();
- }
- }
- class Turniej {
- String miejsce;
- int rok;
- ArrayList<Zawodnik> lista;
- }
- public class main {
- public static void main(String[] args) throws FileNotFoundException {
- // TODO Auto-generated method stub
- Scanner scan = new Scanner(new File("jakiestamchujwieco.txt"));
- Turniej turniej = new Turniej();
- turniej.miejsce = scan.next();
- turniej.rok = scan.nextInt();
- while (scan.hasNext()) {
- Zawodnik zawodnik = new Zawodnik(scan.next());
- zawodnik.skoki.add(new skok(scan.nextDouble(), scan.nextDouble(), scan.nextDouble(), scan.nextDouble(),
- scan.nextDouble(), scan.nextDouble()));
- turniej.lista.add(zawodnik);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement