Guest User

Untitled

a guest
Jun 22nd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. struct difsites{
  3. double preco;
  4. char loja[50];
  5. char site[50];
  6. };
  7. int main(){
  8. int i,j;
  9. double soma, media;
  10. struct difsites MP;
  11. for(i=0;i<6;i++){
  12. printf("Insira o nome da loja: ");
  13. scanf(" %50[^n]s", &MP.loja);
  14. printf("Insira a URL: ");
  15. scanf(" %50[^n]s", &MP.site);
  16. printf("Insira o valor do computador: ");
  17. scanf(" %lf", &MP.preco);
  18. soma+=MP.preco;
  19. media=soma/6.0;
  20. }
  21. printf("Preco medio: R$%.2lfn",media);
  22. }
Add Comment
Please, Sign In to add comment