include stdio include stdlib define define define void in_mas int in i

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <stdio.h>
#include <stdlib.h>
#define M 4
#define N 4
#define H 2
void in_mas(int *in,int a,int b)
{
int i,j;
for (i=0;i<a;i++)
for (j=0;j<b;j++)
scanf ("%d",in+i*b);
}
int fun(int *in,int a,int b)
{
int i,j,k,m,flag=0;
for (i=0;i<M;i++)
{
for (j=0;j<N;j++)
{
if (flag==1)
{
printf("i=%d j=%d\ni=%d j=%d ",i-1,j-1,i,j);
break;
}
flag=1;
for (k=0;(k<H)&&(flag==1);k++)
for (m=0;(m<H)&&(flag==1);m++)
if (*(in+i*H)==1) flag=0;
}
if (flag==1) break;
}
}
int main()
{
int A[M][N];
int i,j;
printf("Vvedite massiv M na N\n");
in_mas(A,M,N);
printf ("\n");
fun(A,M,N);
return 0;
}