Created
October 6, 2020 12:11
-
-
Save Michaelkodji/971b33e0f4717b3f2900d2229f1355b9 to your computer and use it in GitHub Desktop.
Dossard et temps du second dossard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int dosse,dossmt,dossec; float tc,mt,mtsec,tmp; | |
int main() | |
{ | |
do{ | |
cout << "Entrer le dossard du premier concurent" << endl; | |
cin>>dosse; | |
cout<<"Entrer le temps du premier concurent"<<endl; | |
cin>>tc; | |
}while(dosse<0); | |
dossmt=dosse; | |
mt=tc; | |
while(dosse!=0){ | |
if(tc < mt){ | |
tmp=mt; | |
mt=tc; | |
if(tmp>mt){ | |
mtsec=tmp; | |
dossec=dossmt; | |
} | |
dossmt=dosse; | |
} | |
do{ | |
cout <<" Entrer le dossard suivant "<< endl; | |
cin>>dosse; | |
cout<<" Entrer son temps "<<endl; | |
cin>>tc; | |
}while(dosse<0); | |
} | |
cout<<"Le vainqueur est : "<<dossmt<<",son temps est de : "<<mt<<endl; | |
cout<<"Le deuxieme vainqueur est : "<<dossec<<",son temps est de : "<<mtsec<<endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment