首页 > 大学专科> 电子信息
题目内容 (请给出正确答案)
[主观题]

现有如下程序段: include“stdio.h” int aa(int x,int y); void main() { int a=24,b=16,c;

现有如下程序段: include“stdio.h” int aa(int x,int y); void main() { int a=24,b=16,c; c=aa(a,b); printf(“%d\n”,c); } int aa(int x,int y) { int w; while(Y) { w=x%y; x=y; y=w; } return x; } 则程序段的输出结果是()。

A.8

B.7

C.6

D.5

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“现有如下程序段: include“stdio.h” int …”相关的问题
第1题
现有如下程序段,此程序段编译有错误,则程序段的错误出在()。 include <stdio.h> mai

现有如下程序段,此程序段编译有错误,则程序段的错误出在()。 include <stdio.h> main() { int a=30,b=40,c=50,d; d=a>30? b:c; switch(d) {case a:printf("%d,",a); case b:printf("%d,",b); case c:printf("%d,",c); default:printf(""); ) )

A.“default:printf("");”这个语句

B.“d=a>30?b:C;”这个语句

C.“case a:printf(”% d,”,a);case b:printf(”%d,”,b);case c:printf(”%d,”,c);”这三个语句

D.switch(d)这个语句

点击查看答案
第2题
有如下程序: #include<iostream> using namespace std; int main(){ int sum;

有如下程序: #include<iostream> using namespace std; int main(){ int sum; for(int i=0;i<6;i+=3){ sum=i; for(int j=i;j<6;j++)sum+=j; } cout<<sum<<end1; return 0; } 运行时的输出结果是()。

A.3

B.10

C.12

D.15

点击查看答案
第3题
有如下程序:#inCludeusing nameSpace std;Class A{public:A(inti=0):r1(i){}void plint(){cout&l

有如下程序: #inClude using nameSpace std; Class A{ public: A(inti=0):r1(i){ } void plint(){cout<<‘E’<<r1<<‘-’;} void print()const{cout<<‘C’<<r1*r1<<‘-’;} void print(int X){cout<<‘P’<<r1*r1*r1<<‘-’;} prlvate: intrl; }; intmain(){ Aal; constA a2(4); a1.print(2); a2.print(); returh0; } 运行时的输出结果是()。

A.P8-E4

B.P8-C16-

C.P0-E4-

D.P0-C16-

点击查看答案
第4题
现有如下程序: }}include“stdio.h” void fun(int x) { printf(“x=%d\n”,++x); } void main

现有如下程序: }}include“stdio.h” void fun(int x) { printf(“x=%d\n”,++x); } void main() { fun(12+5); ) 则程序的输出结果是()。

A.12

B.13

C.17

D.1 8

点击查看答案
第5题
现有如下程序,则程序的输出结果为()。 include“stdio.h” int f(int a,int b) { int c; i

现有如下程序,则程序的输出结果为()。 include“stdio.h” int f(int a,int b) { int c; if(a>0&&a<10)c=(a+b)/2; else c=a*b/2; return c; } void main() { int a=8,b=20,c; c=f(a,b); printf(“%d\n”,c), }

A.随机数

B.80

C.28

D.14

点击查看答案
第6题
阅读如下程序段 include "stdio.h" void fc(FILE*); main(int argc,char *argv[])

阅读如下程序段 include "stdio.h" void fc(FILE*); main(int argc,char *argv[]) { FILE*fp; int i=1; while(--argc>0) { fp=fopen(argv[i++],"r"); fc(fp); fclose(fp);}} void fc(FILE*p) { char c; while((c=getc(p))!=) putchar(c-32);} 这个程序段编译、连接以后生成可执行文件50.exe,假定磁盘当前目录下有3个文本文件,其文件名和内容分别为: 文件名 内容 k1.txt china k2.txt ese k3.txt year

阅读如下程序段 include "stdio.h" void fc(FILE*); main(int

点击查看答案
第7题
有以下程序 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; } 则该程序运行后的输出结果是【 】。

点击查看答案
第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 using namespace std ; class A { int a, b; public :
阅读下面程序,写出输出结果。#include using namespace std ; class A { int a, b; public :

阅读下面程序,写出输出结果。

#include using namespace std ; class A { int a, b; public : A() { a = b = 0; }

A(int aa, int bb) { a = aa; b = bb; cout << a << ' ' << b << endl ; } }; int main() { A x, y(2,3);

return 0; }

点击查看答案
第10题
下列程序中划线处正确的语句是()。#include <iostream>using namespace std;class Base{public:vo

下列程序中划线处正确的语句是()。#include <iostream>using namespace std;class Base{public:void fun() { cout<<"Base:: fun"<<end1; }};class Derived: public Base{ void fun() { _______________________ //显试调用基类的函数 fun() cout <<"Derived:: fun"<<end1;};

A.fun();

B.Base. fun();

C.Base:: fun();

D.Base->fun();

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