#include<stdlib.h>
#include<stdio.h>
#include<ctype.h>
int mas[200][200],i = 0,j = 0;
char c[20];
int x,y,max;
// Function to read array from txt file.//
void read()
{
FILE *fp = fopen("masyvas.txt","r");
while(!feof (fp))
{
fscanf (fp, "%d", &mas[i][j]);
i++;
printf("%d\n",i);
fscanf(fp,"%c",&c);
printf("%c\n",c);
if(*c == '\n')
{
j++;
i = 0;
}
}
i = 0;
j = 0;
fclose(fp);
}
// Function to find min and max from array need to be improved to find min in row and max in column of same element.//
void find()
{
int a = 0,max = 0,min = 200,b = 0,sk = 45,g = 0;
while(sk != 0)
{
if(mas[a][b] <= min)
{
min = mas[a][b];
}
if(mas[a][b] > max)
{
max = mas[a][b]
}
a++;
if(a == 9)
{
b++;
a = 0;
{
sk--;
}
}
Text File:
5 4 6 4 6 5 4 6 5
7 3 4 5 4 3 5 2 2
6 2 3 6 4 6 4 5 7
3 1 4 5 3 4 6 3 4
2 3 5 2 3 5 2 6 7
Guys I am out of options I tried almost everything I can't think out the way Look at void find() Tell me what must be changed and how I want to find Element which is min ir row and max in his column.
Can find min and max now I made a == 9 becouse it represents position of column in array then it comes to the end of line(9) position in line goes back to 0 and b count of rows is added. I need to find which array elements has minimum value in row and maximum in column. I hope I explained it well.