Advertisement
rdsedmundo

Fliperama.c

Jan 8th, 2014
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main() {
  4.     int n, Quantia;
  5.  
  6.     scanf("%d %d", &n, &Quantia);
  7.  
  8.     int i, j, Placares[n];
  9.  
  10.     for(i = 0; i < n; i++)
  11.         scanf("%d", &Placares[i]);
  12.  
  13.     int Apurados = 0;
  14.  
  15.     callback : NULL;
  16.     int maior = 0;
  17.  
  18.     for(i = 0; i < n; i++) {
  19.         if(Placares[i] > Placares[maior])
  20.             maior = i;
  21.     }
  22.  
  23.     Apurados++;
  24.     printf("%d\n", Placares[maior]);
  25.  
  26.     Placares[maior] = -999;
  27.  
  28.     if(Apurados != Quantia)
  29.          goto callback;
  30.  
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement