全文预览

c语言必考

上传者:徐小白 |  格式:pdf  |  页数:54 |  大小:3767KB

文档介绍
char num[10];\rint s;\r}STREC;\rint fun(STREC *a, STREC *b)\r(\rint i, j=0, max=a[0].s;\rfor(i=0;i<N;i++)\rif(max<a[i]. s) max=a[i]. s;\rfor(i=0;i<N;i++)\rif ( a[i]. s==max ) b[j++]=a[i];\rreturn j ;\r)\rvoid main().\rSTREC s[N] = {{ “GA005” F85}, { “GA003” F76}, { “GA002” F69}, { “GA004” F85},\r{ “GA001” F91}, { “GA007” F72}, { “GA008” F64}, { “GA006” F87}, { “GA0015” F85},\r{ “GA0013” F91}, { “GA0012” F64}, { “GA0014” F91}, { “GAOO11” F66}, { “GAOO17” F64}\r{ “GA0018” F64}, { “GA0016” F72},};\rSTREC h[N];\rint i, n;\rn=fun(s, h );\rp rin tf ( "The %d highest score:\nv , n );\rfor(i=0;i<n;i++)\rprintf ( "Ds % 4d\n"Fh[i]. num, h[i]. s ) ;\rp rin tf ( "\n" ) ;}

收藏

分享

举报
下载此文档