以下程序的功能是将字符串s中的数字字符放人d数组中,最后输出d中的字符串。例如,输入字符串abc123
第1题
第2题
以下程序中函数fun()的功能是构成一个如图所示的带头结点的单向链表,在结点的数据域中放入了具有两个字符的字符串。函数disp的功能是显示输出该单向链表中所有结点中的字符串。请填空完成函数disp。
include <atdio.h> typedef struct node /*链表结点结构*/ { char sub[3]; struct node * next; } Node Node ~un(char s) /*建立链表*/ {......} void disp(Node * h) { Node * Ps p=h->next; while(【 】) { printf("%s\n",p->suh);p= 【 】;} } main() { Node * hd; hd = fun(); disp(hd) ;prinff(" \n" );
第3题
第4题
以下函数的功能是删除字符串s中的所有数字字符。请填空。 viod dele(char *s) { int n=0,i; for(i=0;s [i];i++) if(______) s[n++];s[i]; s[n]= ______; }
第5题
#include<stdio.h>
main()
{char*p,s[6];
int n;
p=s;
gets(p);
n=*p-'0';
while(______!='\0')
n=n*8+*p-'0';
printf("%d\n",n);
}
第6题
下列程序的功能是将字符串s中所有的字符c删除。请填空。 include<stdio.h> main() {char s[80]; int i,j; gets(S); for(i=j0;s[i]!\0;i++) if(s[i]!=c)______; s[j]=\0; puts(S); }
第7题
例如,形参s所指的字符串为:Abe@1x56*。程序执行后t所指字符数组中的字符串应为:A@156*。
请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。
注意:源程序存放在考生文件夹下的BLANKl.C中。
不得增行或删行,也不得更改程序的结构!
第8题
下面程序的功能是将字符串s中所有的字符c删除,补足所缺语句。 include<stdio.h> main() { char s[80]; int i,j; gets(s); for(i=j=0;s[i]!=\0;i++) if(s[i]!=c)【 】; s[j]=\0; puts(s); }
第9题
A.将字符串s1拷贝给s
B.将字符串s拷贝给s1
C.统计字符串s1中有效字符个数
D.将字符串s1连接到s末尾