Advertisement
Guest User

Untitled

a guest
Nov 12th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. void afficher_disqualification(const Inscrits* ins, const Course* crs) {
  2. Course tDisq[maxSkieurs];
  3. Mesure tDsq[maxSkieurs];
  4. unsigned int tDos[maxSkieurs], tPorte[maxSkieurs];
  5. double tTps[maxSkieurs], TEMPS = 0;
  6. unsigned int a = 0, b = 0, cs = 0;
  7. //cs = le numéro de la case
  8. for (unsigned int i = 0; i < crs->taille; ++i) {
  9. Mesure mesure = crs->data[i];
  10. if (mesure.temps == dsq) {
  11. Mesure tmp = tDisq->data[mesure.dossard - 101];
  12. mesure.temps = tmp.temps;
  13. //printf("porte = %d temps = %.2f dossard = %d\n", tmp.porte, mesure.temps, tmp.dossard);
  14. for (unsigned int j = 0; j < crs->taille; j++) {
  15. Mesure Porte0 = crs->data[j];
  16. if (Porte0.porte == 0 && Porte0.dossard == tmp.dossard) {
  17. TEMPS = Porte0.temps;
  18. printf("%.2f\n", TEMPS);
  19. }
  20.  
  21. }
  22. tmp.temps -= TEMPS;
  23. mesure.temps = tmp.temps;
  24.  
  25. tDsq[mesure.dossard - 101] = mesure;
  26. tDos[cs] = mesure.dossard;
  27. tPorte[cs] = mesure.porte;
  28. tTps[cs] = mesure.temps;
  29.  
  30. cs++;
  31. }
  32. else {
  33. tDisq->data[mesure.dossard - 101] = mesure;
  34. }
  35. }
  36.  
  37. for (unsigned int n = 0; n < cs; ++n) {
  38. a = tTps[n];
  39. b = n;
  40. unsigned int tmp = tDos[n];
  41. double tmp2 = tTps[n];
  42. while ((b > 0) && (tTps[b - 1] > a))
  43. {
  44. tPorte[b] = tPorte[b - 1];
  45. tDos[b] = tDos[b - 1];
  46. tTps[b] = tTps[b - 1];
  47. b = b - 1;
  48. }
  49. tPorte[b] = a;
  50. tDos[b] = tmp;
  51. tTps[b] = tmp2;
  52. }
  53.  
  54. for (unsigned int n = 0; n < cs; n++) {
  55. for (unsigned int i = 0; i < ins->nbInscrits; i++) {
  56. if (tDos[n] == ins->data[i].dossard) {
  57. printf(" disqualifie %.2f %d %s %s\n", tTps[n], tDos[n], ins->data[i].nom, ins->data[i].pays);
  58. }
  59. }
  60. }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement