Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int i , n , minutes , time , seconds , minpos = 0 , min = 999 , soma = 0 ;
- scanf ("%d" , &n) ;
- for (i = 0 ; i < n ; i++)
- {
- scanf ("%d %d" , &minutes , &seconds) ;
- time = minutes * 60 + seconds ;
- if (time < min)
- {
- min = time ;
- minpos = i + 1 ;
- }
- soma += time ;
- }
- printf ("O melhor tempo de todas as voltas foi %d minutos e %d segundos.\n" , min / 60 , min % 60) ;
- printf ("O melhor tempo ocorreu na volta número %d.\n" , minpos) ;
- printf ("O tempo médio de todas as voltas foi %d minutos e %d segundos.\n" , soma / 60 / n , soma / n % 60) ;
- return 0 ;
- }
Advertisement
Add Comment
Please, Sign In to add comment