Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #define N 10
- using namespace std;
- double najlepszy_czas (double tab[],int ii )
- {
- double maks=tab[0];
- for (int a=0; a<ii; a++)
- if (tab[a]<maks)
- maks=tab[a];
- return maks;
- }
- int main ()
- {
- double czasy [N],rekord;
- int i,i2;
- double x;
- cout<< "Podaj czasy okrazen kolejnych kierowcow!"<<endl;
- i2=0;
- for (i=0; i<N; i++)
- {
- cout<<"czas osiagniety przez kierowce nr "<<i+1<<" : "<<endl;
- cin>>x;
- if (x==0)
- break;
- else
- czasy[i]=x;
- i2++;
- }
- cout<<" Czasy zawodnikow to:"<<endl;
- for (i=0; i<i2; i++)
- {
- cout<<czasy[i]<<endl;
- }
- rekord=najlepszy_czas(czasy,i2);
- cout<<"rekord wynosi "<<rekord;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement