模拟试题

3773考试网计算机等级考试模拟试题正文

2014年3月全国计算机二级C语言上机模拟试题十六之4

来源:2exam.com 2013-10-30 19:55:47

参考答案: 

  int fun(char *s,int num) 

  { 

  char ch ; 

  int i, j ; 

  for(i = 1 ; i < 6 ; i++) 

  for(j = i + 1 ; j < 6 ; j++) { 

  if(*(s + i) < *(s + j)) { 

  ch = *(s + j) ; 

  *(s + j) = *(s +i) ; 

  *(s + i) = ch ; 

  } 

  } 

  } 

触屏版 电脑版
3773考试网 琼ICP备12003406号-1