Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://www.youtube.com/watch?v=0tuo9rHKvsM
- #include <stdio.h>
- int main()
- {
- int n, tempo, tempo_total = 0, i, acertos = 0;
- char prob, av, atual_errado = ' ';
- scanf("%d", &n);
- while(n != 0)
- {
- for(i = 0; i < n; i++)
- {
- fflush(stdin);
- scanf("%c", &prob);
- scanf("%d", &tempo);
- fflush(stdin);
- scanf("%c", &av);
- if(av == 'I' || av == 'i')
- atual_errado = prob;
- else
- {
- if(atual_errado == prob)
- tempo_total += 20;
- tempo_total += tempo;
- acertos++;
- }
- }
- printf("%d %d\n", acertos, tempo_total);
- acertos = 0;
- tempo_total = 0;
- atual_errado = ' ';
- scanf("%d", &n);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement