Guest User

Untitled

a guest
Jan 17th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #include <math.h>
  2. #include <stdio.h>
  3.  
  4. const int n = 3;
  5. const int s = 3;
  6. int getm(int mat[n][s]);
  7. int printm(int mat[n][s]);
  8.  
  9. int main()
  10. {
  11. int m[n][s];
  12. getm(m);
  13. printm(m);
  14. return 0;
  15. }
  16.  
  17. int getm(int mat[n][s])
  18. {
  19. for(int x = 0;x < n;x++)
  20. {
  21. for (int y = 0;y<s;y++)
  22. {
  23. scanf("%i ", &mat[x][y]);
  24. }
  25. }
  26. return 0;
  27. }
  28. int printm(int mat[n][s])
  29. {
  30. for(int x = 0;x<n;x++)
  31. {
  32. for(int y = 0;y<s;y++)
  33. {
  34. printf("%i ", mat[x][y]);
  35. if(y==(s-1))
  36. {
  37. printf("n");
  38. }
  39. }
  40. }
  41. }
  42.  
  43. scanf("%i ", &mat[x][y]);
  44.  
  45. scanf("%i", &mat[x][y]);
  46.  
  47. for(int x = 0;x<n;x++)
  48. {
  49. for(int y = 0;y<s;y++)
  50. {
  51. printf("%i ", mat[x][y]);
  52. }
  53. printf("n");
  54. }
Add Comment
Please, Sign In to add comment