二级c填空题题库及答案.docVIP

  • 0
  • 0
  • 约1.77千字
  • 约 6页
  • 2026-03-22 发布于河北
  • 举报

二级c填空题题库及答案

1.以下程序段实现将字符数组s中所有数字字符移到所有非数字字符之前,请填空。

```c

includestdio.h

voidfun(chars){

charp1,p2,t;

p1=p2=s;

while(p2){

if(!(p2=0p2=9))

p2++;

else{

t=p2;

while(___){

p1=p1+1;

p1++;

}

p1=t;

}

}

}

intmain(){

chars[]=abc123def456;

fun(s);

printf(%s\n,s);

return0;

}

```

(4分)

2.以下程序的功能是:计算1到100之间的奇数之和与偶数之和,请填空。

```c

includestdio.h

intmain(){

inta,b,c,i;

a=c=0;

for(i=0;i=100;i+=2)

文档评论(0)

1亿VIP精品文档

相关文档