fork download
  1. #include <stdio.h>
  2.  
  3. struct tetris {
  4. char nome[16];
  5. int pontuacao;
  6. };
  7.  
  8. int main() {
  9. int j = -1;
  10. while (scanf("%d", &j) && j != 0) { };
  11. struct tetris jogador[j];
  12. for (int i = 0; i < j; i++) {
  13. scanf("%15s", jogador[i].nome);
  14. printf("LI NOME\n");
  15. int total = 0;
  16. int maior = 0;
  17. int menor = 32767; //tem um risco aqui
  18. for (int k = 0; k <= 11; k++) {
  19. int pontos = 0;
  20. scanf("%d", &pontos);
  21. printf("LI PONTO\n");
  22. total += pontos;
  23. if (pontos > maior) maior = pontos;
  24. else if (pontos < menor) menor = pontos;
  25. if (k == 0) menor = maior;
  26. }
  27. printf("\n");
  28. jogador[i].pontuacao = total - maior - menor;
  29. }
  30. printf("ACABEI\n");
  31. for (int k = 0; k < j; k++) printf("%s %d\n", jogador[k].nome, jogador[k].pontuacao);
  32. }
  33.  
  34. //https://pt.stackoverflow.com/q/84070/101
Success #stdin #stdout 0s 4336KB
stdin
4
Zezinho
100
123
133
333
400
300
129
200
360
340
200
600
Luizinho
60
50
120
250
170
190
190
220
260
270
290
300
Carlinhos
10
10
20
10
10
10
10
20
20
20
20
20
Joaozinho
200
300
400
400
500
500
500
600
650
650
700
810
stdout
LI NOME
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO

LI NOME
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO

LI NOME
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO

LI NOME
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO
LI PONTO

ACABEI
Zezinho 2518
Luizinho 2020
Carlinhos 150
Joaozinho 5200