Answer the question
In order to leave comments, you need to log in
How to make the program drive the minimum?
It is necessary that the program displays the minimum diagonally to the selected cell, it must be done for all cells.
I get all units, how can I fix it? Please help, otherwise the 3rd day is some kind of blunt
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
int a[5][5],k,n,m,l,p,q,x;
int main()
{int i,j,min,max;
printf("Vvedite n i m\n");
scanf("%d%d",&n,&m);
printf("Vvedite massiv\n");
for (i = 0; i <n; i++)
{for (j = 0; j <m; j++)
{
scanf("%d",&a[i][j]);
}
}
printf("min\n");
for (p=0;p<n;p++)
{for (q=0;q<m;q++)
{
min=a[0][0];
max=0;
if (p>q){l=q;}
if (p<q){l=p;}
if (p==q){l=p;}
x=p;
j=q;
for(i=0;i<l;i++)
{
if (a[x][j]<min){min=a[x][j];}
x--;
j--;}
printf("%5d\n",min);}}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question