Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <math.h>
- #include <stdio.h>
- const int n = 3;
- const int s = 3;
- int getm(int mat[n][s]);
- int printm(int mat[n][s]);
- int main()
- {
- int m[n][s];
- getm(m);
- printm(m);
- return 0;
- }
- int getm(int mat[n][s])
- {
- for(int x = 0;x < n;x++)
- {
- for (int y = 0;y<s;y++)
- {
- scanf("%i ", &mat[x][y]);
- }
- }
- return 0;
- }
- int printm(int mat[n][s])
- {
- for(int x = 0;x<n;x++)
- {
- for(int y = 0;y<s;y++)
- {
- printf("%i ", mat[x][y]);
- if(y==(s-1))
- {
- printf("n");
- }
- }
- }
- }
- scanf("%i ", &mat[x][y]);
- scanf("%i", &mat[x][y]);
- for(int x = 0;x<n;x++)
- {
- for(int y = 0;y<s;y++)
- {
- printf("%i ", mat[x][y]);
- }
- printf("n");
- }
Add Comment
Please, Sign In to add comment