Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void afficher_disqualification(const Inscrits* ins, const Course* crs) {
- Course tDisq[maxSkieurs];
- Mesure tDsq[maxSkieurs];
- unsigned int tDos[maxSkieurs], tPorte[maxSkieurs];
- double tTps[maxSkieurs], TEMPS = 0;
- unsigned int a = 0, b = 0, cs = 0;
- //cs = le numéro de la case
- for (unsigned int i = 0; i < crs->taille; ++i) {
- Mesure mesure = crs->data[i];
- if (mesure.temps == dsq) {
- Mesure tmp = tDisq->data[mesure.dossard - 101];
- mesure.temps = tmp.temps;
- //printf("porte = %d temps = %.2f dossard = %d\n", tmp.porte, mesure.temps, tmp.dossard);
- for (unsigned int j = 0; j < crs->taille; j++) {
- Mesure Porte0 = crs->data[j];
- if (Porte0.porte == 0 && Porte0.dossard == tmp.dossard) {
- TEMPS = Porte0.temps;
- printf("%.2f\n", TEMPS);
- }
- }
- tmp.temps -= TEMPS;
- mesure.temps = tmp.temps;
- tDsq[mesure.dossard - 101] = mesure;
- tDos[cs] = mesure.dossard;
- tPorte[cs] = mesure.porte;
- tTps[cs] = mesure.temps;
- cs++;
- }
- else {
- tDisq->data[mesure.dossard - 101] = mesure;
- }
- }
- for (unsigned int n = 0; n < cs; ++n) {
- a = tTps[n];
- b = n;
- unsigned int tmp = tDos[n];
- double tmp2 = tTps[n];
- while ((b > 0) && (tTps[b - 1] > a))
- {
- tPorte[b] = tPorte[b - 1];
- tDos[b] = tDos[b - 1];
- tTps[b] = tTps[b - 1];
- b = b - 1;
- }
- tPorte[b] = a;
- tDos[b] = tmp;
- tTps[b] = tmp2;
- }
- for (unsigned int n = 0; n < cs; n++) {
- for (unsigned int i = 0; i < ins->nbInscrits; i++) {
- if (tDos[n] == ins->data[i].dossard) {
- printf(" disqualifie %.2f %d %s %s\n", tTps[n], tDos[n], ins->data[i].nom, ins->data[i].pays);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement