Advertisement
Avdluna

Untitled

Aug 31st, 2015
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main (){
  4.  
  5. int dist,soma=0,i;
  6. double r;
  7. char nome[200];
  8.  
  9. while (scanf(" %[^\n]",nome) != EOF){
  10.  
  11. scanf("%d",&dist);
  12.  
  13. soma +=dist;
  14.  
  15. i++;
  16.  
  17. }
  18.  
  19. r = soma/i;
  20.  
  21. printf("%.1lf\n",r);
  22.  
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement