首页 > 高职专科
题目内容 (请给出正确答案)
[主观题]

若有如下程序: include "stdio.h" main() { char s[30]; Strcpy(&S[0],"

若有如下程序: include "stdio.h" main() { char s[30]; Strcpy(&S[0],"adc"); Strcpy(&S[1],"def"); strcpy(&S[2],"gh");; printf("%S\n",s); 则程序运行后的输出结果是【 】。

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“若有如下程序: include "stdio.h" main…”相关的问题
第1题
有如下程序:#include<iostream>using namespace std;class B{public:Virtual void show(){cout<<

有如下程序: #include<iostream> using namespace std; class B{ public: Virtual void show(){cout<<“B”;} }; class D:publicB{ public: void show(){cout<<“D”;} }; void funl(B*ptr){ptr->show();} void{un2(B&ref){ref.show();} void

A.BBB

B.BBD

C.DBB

D.DBD

点击查看答案
第2题
有如下程序:#include <iostream>using namespace std;int main(){ int *p; *p = 9;cout << "The

有如下程序: #include <iostream> using namespace std; int main() { int *p; *p = 9; cout << "The value at p: " << *p; return 0; } 编译运行程序将出现的情况是()。

A.编译时出现语法错误,不能生成可执行文件

B.运行时一定输出:The value at p:9

C.运行时一定输出:The value at p:*9

D.运行时有可能出错

点击查看答案
第3题
有如下程序:#include<iostream>using namespace std;class Test{public:Test(){n+=2;}~Test(){n-

有如下程序: #include<iostream> using namespace std; class Test{ public: Test() {n+=2;} ~Test() {n-=3;} static int getNum(){return n;} private: static int n; }; int Test::n=1; int main() { Test*p=new Test; delete p; cout<<"n="<<Test::getNum()<<endl; return 0; } 执行后的输出结果是()

A.n=0

B.n=1

C.n=2

D.n=3

点击查看答案
第4题
若有以下程序:  #include <iostream>  using namespace std;  class Base  {  private:   int a,b;  public:   Base(int x, int y)   {     a=x;     b=y;   }   void disp ()   {     cout<<a<<" "<<b<<end1;   }  };  class Derived : public Base  {  private:   int c;   int d;  public:   Derived(int x,int y, int z,int m) :Base(x,y)   {     c=z;     d=m;   }   void disp ()   {     cout<<c<<" "<<d<<end1;   }  };  int main()  {   Base b(5,5),*pb;   Derived obj(1,2,3,4);   pb=&obj;   pb->disp();   return 0;  }  执行程序后的输出结果是()。

A.1,2

B.3,4

C.2,3

D.5,5

点击查看答案
第5题
若有如下程序: include"stdio.h" main() {char s[30]; strcpy(&s[0],"abc"); st

若有如下程序: include"stdio.h" main() {char s[30]; strcpy(&s[0],"abc"); strcpy(&s[1],"de"); strcpy(&s[2],"f"); printf("%s\n",s); } 则程序运行后的输出结果是【 】。

点击查看答案
第6题
若有如下程序,则程序运行结果为:()#include<stdio. h>main(){ int x=1, a=0;switch (x)case 1:a++;case 2: a++ ;break;case 3: a++ ; break;printf(”a=%d\n" ,a)

A.=0

B.=1

C.=2

D.=3

点击查看答案
第7题
若有如下程序: #include"stdio.h" void main() {FILE *fp; fp=fopen("test","wb"); fprintf(fp,"%d%.1f,%c%c",5,238.41,'B','h'); fclose(fp); } 则程序运行后向文件输出的结果是()。

A.5238.41Bh

B.5238.4,Bh

C.5,238.4,B,h

D.5238.41Bh

点击查看答案
第8题
下列程序的输出结果是 #inClUde<iostream> using namespace std; intmain() { Char a[]="HellO,W

下列程序的输出结果是

#inClUde<iostream>

using namespace std;

intmain()

{

Char a[]="HellO,World";

Char*ptr=a;

while(*ptr)

{

if(*ptr>='a'&& *ptr <='Z')

cout<<char(*ptr+'A' -'a');

else cout<<*ptr;

ptr++;

}

retur0;

}

A.HELLO,WORLD

B.Hello,world

C.hELLO,wORLD

D.hellO,world

点击查看答案
第9题
有以下程序 include <lostream> using namespace std; int main() { int

有以下程序 include <lostream> using namespace std; int main() { int i=010,j=10; cout<<(i)<<","<<j--<<endl; return 0; } 则该程序运行后的输出结果是【 】。

点击查看答案
第10题
下列程序的输出结果是______。 include<iostream> using namespace std; void fun(int &rf) {

下列程序的输出结果是______。

include<iostream>

using namespace std;

void fun(int &rf)

{

rf*=2;

}

int main()

{

int num=500;

fun(num);

cout<<num<<endl;

return 0;

}

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改