- A.Zhang
- B.Zhao
- C.Wang
- D.18
- A.*(*(a+i)+j)
- B.(a+i)[j]
- C.*(a+i+j)
- D.*(a+i)+j
- A.1,2,3,0,0,0,0,0,0,0,
- B.1,2,3,1,2,3,0,0,0,0,
- C.123,0,0,0,0,123,0,0,0,0,
- D.1,2,3,0,0,1,2,3,0,0,
- A.3
- B.6
- C.9
- D.随机数
- A.0xFFEE
- B.0x71
- C.0x0071
- D.0xFFF1
下列给定的程序中,函数proc的功能是:判断字符ch 是,与str所指字符串中的某个字符相同;若相同,则什么也不做,若不同,则将其插在串的最后。请修改程序中的错误,使它能得出正确的结果。
注意:不要改动main函数,不得增行或删行,也不得更改程序的结构。
试题程序:
#include
#include
#include
#include
//****found****
void proc(char str,char ch)
{
while(*str &&*str!=ch)str++;
//****found****
if(*str==ch)
{ str[0]=ch;
//****found****
str[1]='0':
}
}
void main
{
char str[81],ch;
system("CLS");
printf("\nPlease enter a string:");
gets(str);
printf("\n Please enter the character to
search:");
ch=getchar;
proc(str,ch);
printf("\nThe result is%s\n",str);
}
订单号:
遇到问题请联系在线客服
订单号:
遇到问题请联系在线客服