Advertisement
Guest User

Untitled

a guest
May 22nd, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. int main()
  4. {
  5. int mat[3][4],u,i,custo[4]{0,0,0,0},aux=0,resul1=0,arm;
  6. float vet[3],mat2[3][4];
  7. for(i=0;i<3;i++){
  8. scanf("%f",&vet[i]);
  9. }
  10.  
  11. for(i=0;i<4;i++)
  12. {
  13. for(u=0;u<3;u++)
  14. {
  15. scanf("%d",&mat[i][u]);
  16. custo[i]=custo[i]+mat[i][u];
  17. mat2[i][u]=mat[i][u]*vet[u];
  18. }
  19. if (custo[i]>resul1){
  20. resul1=custo[i];
  21. arm=i+1;}
  22.  
  23. }
  24. i=1;
  25. for(u=0;u<4;u++)
  26. {
  27. printf("no armazem %d estao guardados %d produtos\n",i,custo[u]);i++;
  28. }
  29.  
  30. printf("o armazem %d tem mais produtos\n",arm);
  31.  
  32. for(i=0;i<4;i++)
  33. {
  34. for(u=0;u<3;u++)
  35. {
  36. printf("%.2f ",mat2[i][u]);
  37. }
  38. printf("\n");
  39. }
  40.  
  41.  
  42. return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement