char c;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
fscanf(f, "%d", &pole[i][j]);
fscanf(f, "%c", &c);
printf("%d ",pole[i][j]);
}
printf("\n");
}
#define MAX_SAME 2
...
void search_matrix( int* matr, const int limit )
{
int same_count = 0;
int i = 0;
int j = i + 1;
while ( same_count < MAX_SAME && i < limit*limit - 1 ) {
if ( matr[ i ] == matr[ j ] ) {
same_count++;
}
if ( same_count < MAX_SAME ) {
j++;
if ( j == limit*limit ) {
i++;
same_count = 0;
j = i + 1;
}
}
}
if ( same_count == MAX_SAME ) {
cout << same_count << ' ' << i << ' ' << j;
}
}