猿问

c语言 二维数组求鞍点 大一萌新求纠错

#include<stdio.h>int main(){ int x,y; printf("请告诉我你想输入的数组有几行几列\n"); scanf("%d,%d",&x,&y); printf("\n"); printf("请输入这个数组\n"); int a[x][y]={0},i,j; for(i=0;i<x;i++) { for(j=0;j<y;j++) { scanf("%d",&a[i][j]); } } int p[x]={0},q[y]={0}; for(i=0;i<x;i++) p[i]=a[i][0]; for(j=0;j<y;j++) q[j]=a[0][j]; for(i=0;i<x;i++) { for(j=0;j<y;j++) { if(a[i][j]>p[i]) p[i]=a[i][j]; } } for(j=0;j<y;j++) { for(i=0;i<x;i++) { if(a[i][j]<q[j]) q[j]=a[i][j]; } } for(i=0;i<x;i++) { for(j=0;j<y;j++) { if(p[i]==q[j]) printf("%d\n",p[i]); } } return 0;}


小明23333
浏览 2296回答 2
2回答

慕用4063026

试试定义xy时直接直接初始化0,二维数组你的y必须已知,多看看报错

东风冷雪

无语。。。。。。。。。。。。int  a[x][y]; //好好看看书吧。c没有这个操作,动态数组,二维的不好输,百度吧。

慕瓜9220888

UFRFEEHEBCEMAVZVSZOZJILFGTOSKCNFICEMTZJVIPCSFTINGVFVXXOMBNPSFCWOUEUMCWCMOTLKSWZFVARNZLOROBKSBDTSLIPCOGILOOHOMEWCRKHAIESUDYCISWBBEUGAQWECAZBEUDAGTBNZYERWEOZBDHUBELDUQQCGTFDFNPOQHXKKBXDPFVYBZPXIENNNTHGOQPREBYFXLDFHLBOHNLLXFSWMAPAUWVLOLCXSLRJWSOMSJSDPANBFCNMHQGZGNRFHZAQXNYLCOQMZIFQOCBHZWPMJZVXTFSVFQTOVKZPWDNKBRQMFVSXLACEMJWUSWRAZBVBIGBMEQMFSFPUKFOUXUNHUFKMSVOVCGHNPBHROSVDYAWQTGNCKZBAGGCUTLXBXXDAKFZLOZWZGALDVLGNEXVJEJLMIBFWFHXWTNZXENMWSSUYCXZHJVRADQKUIFQCJJFDDOWIBRWFGMXQLXKKHAZACONUHNKSCHQVIPCGFZRTSYIBC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