<\rVoid maxminexchange (int a ÀH int n)\r(\rInt max = a [0], min = a [0], maxp = 0, MINP = 0;\rInt " /> <\rVoid maxminexchange (int a ÀH int n)\r(\rInt max = a [0], min = a [0], maxp = 0, MINP = 0;\rInt " />

全文预览

c语言期末必考40题(Clanguagestudy40finalquestions)

上传者:蓝天 |  格式:pdf  |  页数:62 |  大小:4272KB

文档介绍
for .NET.\rPrintf ("count =% D, sum =% d \ n”, count, sum);\r40.\r# include stdio. h > <\rVoid maxminexchange (int a ÀH int n)\r(\rInt max = a [0], min = a [0], maxp = 0, MINP = 0;\rInt i, t ;\rFor (I = 0; I < n; I + +)\r(\rIf (a [i] > max)\r(\rMax = a [i];\rMaxp = I;\r).\rIf (a [i] < min)\rMin = a [ i ] ;\rMINP = I;\r)\r)\rT = [maxp];\r[maxp] = [MINP];\r[MINP] = t;\r)\rMain ()\r(\rInt a [5], I ;\rP rin tf ("please enter number:");\rFor (I = 0; I < 5; I + +).\rScanf ("% d”, & [i]);\rMaxminexchange (a, I ) ;\rFor (I = 0; I < 5; I + +)\rPrintf ("% 2", [ i] ) ;

收藏

分享

举报
下载此文档