Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main(){
  4.  
  5.  
  6. int i,j;
  7. float mat1[5][5];
  8. float mat2[5][5];
  9. float rmat[5][5];
  10.  
  11. //Daten einlesen
  12. for (i=0;i<5;i++){
  13.  
  14. for (j=0;j<5;j++){
  15.  
  16. cin>> mat1[i][j];
  17. cin>> mat2[i][j];
  18. }
  19.  
  20. }
  21.  
  22. //Berechnen
  23.  
  24. for(i=0;i<5;i++){
  25. rmat[i][i]=0;
  26.  
  27. for(j=0;j<5;j++) {
  28.  
  29. rmat[i][j]+=mat1[i][j]*mat2[j][i];
  30. cout<< rmat[i][j];
  31. }
  32.  
  33. cout<<endl;
  34.  
  35. }
  36.  
  37. return 0 ;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement