问答题

运行时从键盘上输入字符串Student和t,以下程序运行后的输出结果是( )      
#include
#include
void func(char s[],char c1)
{
char new_s[30];
int i,j;
for(i=0,j=0;s[i]!='\0';i++)
if(s[i]!=c1)
new_s[j++]=s[i];
new_s[j]='\0';
strcpy(s,new_s);
}
int main()
{     char s1[30],s2[30];
       int i,j; char c;
       printf("please input a string:");
       gets(s1);
       printf("please input a random character:");
       c=getchar();
       func(s1,c);
       puts(s1);
       return 0;
}

答案: Suden
题目列表

你可能感兴趣的试题

不定项选择

微信扫码免费搜题