Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- const int a = 3;
- int d = 100;
- void fools(int *m, int l)
- {
- int count = 0;
- for(int i = 0; i < l; i++)
- {
- for(int j = 0; j < l; j++)
- {
- if (*(m + i*l + j) == 0)
- {
- *(m + i*l + j) = d;
- count++;
- }
- }
- }
- printf("%d\n", count);
- }
- int main()
- {
- int mass[3][3] = {{1, 2, 0}, {0, 5, 6}, {7, 0, 9}};
- fools(*mass, a);
- for(int i = 0; i < a; i++)
- {
- for(int j = 0; j < a; j++)
- {
- printf("%d", mass[i][j]);
- }
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement