学校的离谱作业
描述:在 n 行 n 列的矩阵中,每行都有最大的数,程序求这 n 个最大数中的最小值问题:如何在不修改其它代码的条件下,在"_______"处填入代码解决问题
#include <stdio.h>
#define N 5
int a;
void main()
{
int row,col,max,min=0;
for(row=0;row<N;++row)
for(col=0;col<N;++col)
{
a=row+col; //每行首位分别为:0,1,2,3,4
}
for(row=0;row<N;row++)
{
for(max=a,col=1;col<N;col++)
if (max<a) max=a;
if (________) min=max;
}
printf ("The min of max numbers is %d\n",min);
}
{:10_269:}我也不会 支持一下吧 混点鱼币 {:10_245:} 刚学,看不懂 我也不会{:5_99:} 只看题目描述和需要填代码的地方盲猜应该填min>max 咋一个个都这样呢,那我也蹲呗 真的是很离谱,为什么不干脆出个 1 + 1 = ? 这有什么难的,不就是在 if 那里改一下 min 的初值么,简单
#include <stdio.h>
#define N 5
int a;
//void main()
int main()
{
int row,col,max,min=0;
for(row=0;row<N;++row)
for(col=0;col<N;++col)
{
//a=row+col; //每行首位分别为:0,1,2,3,4
a= getchar();
}
for(row=0;row<N;row++)
{
for(max=a,col=1;col<N;col++)
if(max<a) max=a;
//if (________) min=max;
if(({static int flag = 0; if(!flag) {flag = 1; min = max;}}), min > max) min=max;
}
//printf ("The min of max numbers is %d\n",min);
printf ("The min of max numbers is %d\n", min);
return 0;
}
#include <stdio.h>
#define N 5
int a;
//void main()
int main()
{
int row,col,max,min=0;
for(row=0;row<N;++row)
for(col=0;col<N;++col)
{
//a=row+col; //每行首位分别为:0,1,2,3,4
a= getchar();
}
for(row=0;row<N;row++)
{
for(max=a,col=1;col<N;col++)
if(max<a) max=a;
//if (________) min=max;
//if(({static int flag = 0; if(!flag) {flag = 1; min = max;}}), min > max) min=max;
//if(({if(row == 0) min = max;}), min > max) min=max;
if(row == 0 ? min = max : 0, min > max) min=max;
}
//printf ("The min of max numbers is %d\n",min);
printf ("The min of max numbers is %d\n", min);
return 0;
}
这是哪个语言
页:
[1]