libdo

Untitled

Nov 1st, 2017
10,356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #define n 3
  4. #define m 2
  5. int main()
  6. {
  7. int pcarro[n][m], pmodelo[m][n],i,j,k,pmatriz[3][3]={0};
  8.  
  9. for(i=0;i<n;i++)
  10. for(j=0;j<m;j++)
  11. {
  12. printf("pcarro[%d][%d]",i+1,j+1);
  13. scanf("%d", &pcarro[n][m]);
  14. }
  15. for(i=0;i<m;i++)
  16. for(j=0;j<n;j++)
  17. {
  18. printf("pmodelo[%d][%d]",i+1,j+1);
  19. scanf("%d", &pmodelo[m][n]);
  20. }
  21. for(i=0;i<n;i++)
  22. for(j=0;j<n;j++)
  23. for(k=0;k<m;k++)
  24. {
  25. pmatriz[i][j]+=pcarro[i][k]*pmodelo[k][j];
  26. }
  27. system("cls");
  28. for(i=0;i<3;i++){
  29. printf("|");
  30. for(j=0;j<3;j++)
  31. printf("%6d",pmatriz[i][j]);
  32. printf("|\n");
  33.  
  34. }
  35.  
  36. return 0;
  37. }
Add Comment
Please, Sign In to add comment