a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 75|回复: 0

[考试试题] 全国计算机等级考试二级C语言模拟试题一(7)

[复制链接]
发表于 2012-7-31 21:53:42 | 显示全部楼层 |阅读模式
  31.以下程序中函数sort的功能是对a数组中的数据进行由大到小的排序
+ D1 w- L# b4 M  void sort(int a[],int n)5 W- I4 j. h/ E( h1 {
  { int i,j,t;1 z8 S" O* X& W: m
  for(i=0;ifor(j=i+1;jif(a[i]}5 r' s3 F! T) @+ j5 J
  main()
" s$ N/ T. S, z6 \1 ~( m5 c  { int aa[10]={1,2,3,4,5,6,7,8,9,10},i;
" w4 Y) c2 l5 o$ M' T  sort(&aa[3],5);* t' l* Q- m+ Y. v7 e3 j4 x/ n
  for(i=0;i
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Woexam.Com ( 湘ICP备18023104号 )

GMT+8, 2024-6-2 22:29 , Processed in 0.221686 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表