當前位置:成語大全網 - 書法字典 - c字典值遍歷

c字典值遍歷

# include & ltstdio.h & gt

# include & ltstdlib.h & gt

int main()

{

int i,m,N[20];

int dmax

Printf("請輸入壹組數據:\ n ");

for(I = 0;我& lt20;i++)

scanf("%d ",& ampn[I]);

m = I;

dmax = N[0];

dmin = N[0];

for(I = 1;我& lt= m;i++)

{

if(dmax & lt;N[I])dmax = N[I];

如果(dmin & gt;N[I])dmin = N[I];

}

Printf("最大值和最小值是:%d%d\n ",dmax,dmin);

系統(“暫停”);

返回0;

}