求各位大侠帮忙啊!!输入一个数,如何得出小的当中最大的,大的当中最小的??
# define N 36main()
{struct Kmz
{float v;
float k;
}vKmz[36]={{200,0.0095},{260,0.0095},{280,0.0096},{300,0.0098},{320,0.0100},{340,0.0104},{360,0.0105},{380,0.0105},{400,0.0105},{420,0.0104},{440,0.0103},{460,0.0102},{480,0.0101},{500,0.0101},{520,0.0100},{540,0.0099},{560,0.0098},{580,0.0098},{600,0.0097},{620,0.0096},{640,0.0096},{660,0.0095},{680,0.0095},{700,0.0094},{720,0.0094},{740,0.0093},{760,0.0092},{780,0.0091},{800,0.0091},{850,0.0090},{900,0.0089},{950,0.0088},{1000,0.0088},{1050,0.0088},{1100,0.0087},{1150,0.0086}};
输入一个数,得出比它小的当中最大的,比它大的当中最小的!!
例如:输入:270;得出260,0095和280,0096!
应该用什么方法啊??
[[it] 本帖最后由 chlhch1985 于 2008-5-28 03:46 编辑 [/it]]