Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #define N 5
- using namespace std;
- double whoisbest(double tab[],double ile)
- {
- double maximus=tab[0];
- for(int i=0;i<ile;i++)
- {
- if(maximus>tab[i])
- maximus=tab[i];
- }
- return maximus;
- }
- int main()
- {
- double przejazdy[N],x;
- int licznik=0;
- for(int i=0;i<N;i++)
- {
- cout<<"Podaj czas przejazdu nr " <<i+1<<endl;
- cin>>x;
- if(x==0)
- break;
- else
- przejazdy[i]=x;
- licznik++;
- }
- cout<<whoisbest(przejazdy,licznik)<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement