填空题

当运行以下程序时,输入abcd,程序的输出结果是: _________。 insert(char str[]) { int i; i=strlen(str); while(i>0) { str[2*i]=str[i]; str[2*i-1]= ’’*’’; i--;} printf("%s\n",str); } main() { char str[40]; scanf("%s\n",str); insert(str); }

【参考答案】

a*b*c*d*
<上一题 目录 下一题>
热门 试题

填空题
在类的对象被创建的时候,【 】函数会被自动调用。
填空题
如下程序声明了一个电话号码类PhoneNumber,重载了流插入运算符<<,以便于电话号码的输出。请将程序补充完整。# include<iostream># include<iomanip># include<string>using namespace std;class PhoneNumber{public:void setNumber(string number) {this-->number = number;} 重载流插入操作符friend 【 】 (ostream &output,const PhoneNumber &num){ output<<num. number; return output; }private:string number;};int main() {PhoneNumber phone;phone. setNumber( 8008100598 );cout<< The phone number is: <<phone<<endl;return 0;}
相关试题
  • 下列选项,不正确的是( )。
  • 与y=(x>0 1:x<0 -1:0);的...
  • 有如下类定义: Class MyClass{ int v...
  • 有如下说明int a[10]:{ 1,2,3...
  • 有以下程序段struct st{int x;int *y...