Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- //package zadacamaraton;
- import java.util.Scanner;
- /**
- *
- * @author Besnik
- */
- /*class IMaraton{
- Atleticar najdobroVreme(){
- }
- int atleticariOd(String s){
- }
- }*/
- class Atleticar{
- public String ime;
- public String pol;
- public int vozdrast;
- public double vreme;
- public String zemja;
- public Atleticar(String ime, String pol, int vozdrast, double vreme, String zemja) {
- this.ime = ime;
- this.pol = pol;
- this.vozdrast = vozdrast;
- this.vreme = vreme;
- this.zemja = zemja;
- }
- public void setIme(String ime) {
- this.ime = ime;
- }
- public void setPol(String pol) {
- this.pol = pol;
- }
- public void setVozdrast(int vozdrast) {
- this.vozdrast = vozdrast;
- }
- public void setVreme(double vreme) {
- this.vreme = vreme;
- }
- public void setZemja(String zemja) {
- this.zemja = zemja;
- }
- public String getIme() {
- return ime;
- }
- public String getPol() {
- return pol;
- }
- public int getVozdrast() {
- return vozdrast;
- }
- public double getVreme() {
- return vreme;
- }
- public String getZemja() {
- return zemja;
- }
- }
- class Maraton{
- public String mesto;
- public int Godina;
- Atleticar[] atleticari;
- public Maraton(String mesto, int Godina, Atleticar[] atleticari) {
- this.mesto = mesto;
- this.Godina = Godina;
- this.atleticari = atleticari;
- }
- public String getMesto() {
- return mesto;
- }
- public int getGodina() {
- return Godina;
- }
- public Atleticar[] getAtleticari() {
- return atleticari;
- }
- public void setMesto(String mesto) {
- this.mesto = mesto;
- }
- public void setGodina(int Godina) {
- this.Godina = Godina;
- }
- public void setAtleticari(Atleticar[] atleticari) {
- this.atleticari = atleticari;
- }
- int najdobroVreme(){
- return 1;
- }
- int atleticariOd(String s){
- return 1;
- }
- }
- public class ZadacaMaraton {
- public static void main(String[] args) {
- Scanner input=new Scanner(System.in);
- int n=input.nextInt();
- Atleticar[] atleticari = new Atleticar[n];
- String ime;
- String pol;
- int vozrast;
- double vreme;
- String zemja;
- input.nextLine();
- for(int i=0;i<n;i++)
- {
- ime = input.nextLine();
- pol = input.nextLine();
- vozrast = input.nextInt();
- vreme = input.nextDouble();
- input.nextLine();
- zemja = input.nextLine();
- atleticari[i]=new Atleticar(ime,pol,vozrast,vreme,zemja);
- }
- String mesto;
- int godina;
- String zemjaP;
- mesto = input.nextLine();
- godina = input.nextInt();
- input.nextLine();
- Maraton m1 = new Maraton(mesto, godina, atleticari);
- System.out.print(m1.toString());
- zemjaP = input.nextLine();
- System.out.println("Prvo mesto: " + m1.najdobroVreme().toString());
- System.out.println("Ima vkupno " + m1.atleticariOd(zemjaP) + " atleticar/i od " + zemjaP);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement