全文预览

c语言全部章节复习

上传者:upcfxx |  格式:pdf  |  页数:56 |  大小:4715KB

文档介绍
num[10];\rint s ;\r^STREC;\rint fun(STREC *a, STREC *b)\r(\rint i, j=0, max=a[O]. s ;\rfor (i=0;i<N;i++)\rif (max<a[i]. s) max=a[i]. s ;\rfor (i=0;i<N;i++)\rif( a Ei]. s==max ) b[j++]=a[i];\rreturn j ;\r/oid main ()\rSTREC s[N] = {{ “GA005”@85}, { “G A 0 0 3 " @76}, { “G A 0 0 2 " @69}, { “G A 0 0 4 " @85},.\r{ “GA001” @91}, { “GA007"@72}, { “GA008"@64}, { “GA006"@87}, { “GA0015” @85},\r{ “GA0013” @91}, { “GA0012” @64}, { “GA0014” @91}, { “GAOO11"@66}, { “GA0017” @64},\r{ “GA0018” @64}, { “GA0016” @72},};\r5TREC h[N];\rint i, n;\ri=fun(s, h );\r)rin tf( "The %d highest score:\nM , n );\rfor(i=0;i<n;i++)\r)rin tf ( "%s %4d\n)> , h [i]. num, h[i]. s ) ;\r)rin tf ( " \ n " );

收藏

分享

举报
下载此文档