Advertisement
Guest User

mag

a guest
Nov 13th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4.  
  5. ifstream in("MATRICE.IN");
  6. ofstream out("MATRICE.OUT");
  7.  
  8. void matrice (int a[20][20],int n)
  9. {
  10. int i,j;
  11. for (i=1;i<=n;i++)
  12. for (j=1;j<=n;j++)
  13. in>>a[i][j];
  14. for (i=1;i<=n;i++)
  15. {
  16. for (j=1;j<=n;j++)
  17. cout<<a[i][j]<<" ";
  18. cout<<endl;
  19. }
  20. }
  21.  
  22. void liniax (int a[20][20],int n)
  23. {
  24. int i,j,x;
  25. cin>>x;
  26. for (j=1;j<=n;j++)
  27. cout<<a[x][j]<<" ";
  28. cout<<endl;
  29. }
  30.  
  31. void vector (int a[20][20],int n)
  32. {
  33. int i,j,v[20],c;
  34. cin>>c;
  35. for (i=1;i<=n;i++)
  36. {
  37. v[i]=a[i][c];
  38. out<<v[j]<<" ";
  39. }
  40. }
  41.  
  42. void cmmmc (int a[20][20],int n)
  43. {
  44. int cmmmc,i,j,d[20][20];
  45. for (j=1;j<=n;j++)
  46. for (i=1;i<=n;i++)
  47. d[i][j]=a[i][j];
  48. }
  49.  
  50. int main ()
  51. {
  52. int a[20][20],n;
  53. in>>n;
  54. matrice (a,n);
  55. liniax (a,n);
  56. vector (a,n);
  57. return 0;
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement