Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int n;
  5. float m=0;
  6.  
  7. scanf("%d",&n);
  8. float vetor[n];
  9. for(int i=0;i<=n;i++){
  10.  
  11. scanf("%f",&vetor[i]);
  12.  
  13. }
  14. for(int i=n-1; i>=0;i--){
  15.  
  16. m=vetor[i]+m;
  17. }
  18.  
  19. printf("%.2f",m/n);
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement