FranciscoSoccol

Lista 09 - Exercicio 05

Sep 8th, 2013
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.25 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6.     int i, soma=0;
  7.     float media;
  8.     for(i=1;i<=argc;i++)
  9.         soma+=atoi(*(argv+i));
  10.     media=soma/(argc-1);
  11.     printf("\nMedia: %.2f\n",media);
  12.     return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment