网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
有一个名为init.txt的文件,内容如下: #define HDY(A,B) A/B #define PRINT(Y) Printf(“y=%dn”,Y) 有以下程序 #include“init.txt” void main() {int a=1,b=2,c=3,d=4,k; k=HDY(a+c,b+d); PRINT(k); } 下面针对该程序的叙述正确的是()。
A.编译有错
B.运行出错
C.运行结果为y=0
D.运行结果为 y=6
参考答案和解析
D
更多 “有一个名为init.txt的文件,内容如下: #define HDY(A,B) A/B #define PRINT(Y) Printf(“y=%dn”,Y) 有以下程序 #include“init.txt” void main() {int a=1,b=2,c=3,d=4,k; k=HDY(a+c,b+d); PRINT(k); } 下面针对该程序的叙述正确的是()。A.编译有错B.运行出错C.运行结果为y=0D.运行结果为 y=6” 相关考题
考题
有一个名为 init.txt 的文件,内容如下:#define HDY(A,B) A/B#define PRINT(Y) Printf("y=%d\n",Y)有以下程序#include "init.txt"main( ){ int a=1,b=2,c=3,d=4,k ;k =HDY(a+c , b+d) ;PRINT( k ) ;}下面针对该程序的叙述正确的是A) 编译出错B) 运行出错C) 运行结果为 y=0D) 运行结果为 y=6
考题
有一个名为init.txt的文件,内容如下:#define HDY(A,B) A/B # define PRINT(Y) Printf(“y=%d\n.,Y) 有以下程序#include “init.txt” main() {int a=1,b=2,c=3,d=4,k; K=HDY(a+c,b+d); PRINT(K); } 下面针对该程序的叙述正确的是( )。A.编译有错B.运行出错C.运行结果为 y=0D.运行结果为 y=6
考题
下面程序的输出结果是【】。define MIN(a,b) (((a)void main(){int
下面程序的输出结果是【 】。define MIN(a,b) (((a)<(b))?a:b)include <iostream.h>void main(){int x= 3, y=5;cout<< MIN(x,y)<<end1;}
考题
以下程序的运行结果是#define MAX(A,B)(A)(B)?(A):(B)#define PRINT(Y) printf("Y=%d\t",Y)main(){ int a=1,b=2,c=3,d=4,t;t=MAX(a+b,c+d);PRINT(t); }A.Y=3B.存在语法错误C.Y=7D.Y=0
考题
以下程序的运行结果是#define MIN(x,y)(x)(y)?(x):(y)main(){ int i=10,j=15,k;k=10*MIN(i,j);printf("%d\n",k);}A.10B.15C.100D.150
考题
请选出以下程序段的输出结果______。includedefine MIN(x,y)(x)
请选出以下程序段的输出结果______。 #include<stdio.h> #define MIN(x,y) (x)<(y)?(x):(y) main() { int i,j,k;i=10;j=15; k=10*MIN(i,j); printf("%d\n",k); }A.15B.100C.10D.150
考题
以下程序的输出结果是______。 include define FUDGE(y)2.84+y define PR(a) printf(
以下程序的输出结果是______。 #include<stdio.h> #define FUDGE(y) 2.84+y #define PR(a) printf("%d",(int)(a)) #define PRINT1(a) PR(a);putchar('\n') main() { int x=2; PRINT1(FUDGE(5)*x); }A.11B.12C.13D.15
考题
阅读下列C++程序和程序说明,将应填入(n)处的字句写在对应栏内。【说明】Point是平面坐标系上的点类,Line是从Point派生出来的直线类。include <iostream.h>class Point{public:Point (int x, int y) ;Point (Point p) ;~Point();void set (double x, double y) ;void print();private:double X,Y;};Point::Point (int x, int y) //Point 构造函数{X=x; Y=y; }Point::Point ( (1) ) //Point 拷贝构造函数{X=p.X; Y=p.Y;}void Point::set (double x, double y){X=x; Y=y; }void Point::print(){cout<<' ('<<X<<","<<Y<<") "<<endl; }Point::~Point(){cout<<"Point 的析构函数被调用! "<<endl;class Line: public Point{public:Line (int x, int y, int k) ;Line (Line s) ;~Line();void set (double x, double y, double k)void print();private:double K;};(2)//Line 构造函数实现{ K=k;}(3)//Line 拷贝构造函数实现{K=s.K;}void Line::set (double x, double y, double k){ (4);K=k;}void Line::print(){cout<<" 直线经过点";(5);cout<<"斜率为: k="<<K<<endl;}Line: :~Line(){cout<<"Line 析构函数被调用! "<<endl;}void main(){Line 11 (1,1,2) ;11 .print();Linel2 (11) ;12.set (3,2,1) ;12.print();}
考题
有以下程序 include define F(X,Y) (X)*(Y) main( ) { int a=3, b=4; prin
有以下程序#include <stdio.h>#define F(X,Y) (X)*(Y)main( ){ int a=3, b=4;printf("%d\n", F(a++, b++));}程序运行后的输出结果是A.12B.15C.16D.20
考题
有以下程序:include defineF(X, Y)(X)*(Y)main ( ){int a=3,b=4;printf("%d\n",F(
有以下程序:#include <studio. h >#define F(X, Y) (X)*(Y)main ( ){ int a=3, b=4; printf("%d\n", F(a++, b++));}A.12B.15C.16D.20
考题
以下程序的输出结果是_________。 #include<stdio.h #defineFUDGE(y) 2.84+y #define PR(A) printf("%d",(int)(A) ) #definePRINT1(A) PR(A) ;putchar('\n') main() { int x=2; PRINT1(FUDGE(5)*X); }A.11B.12C.13D.15
考题
有以下程序段:includedefine MAX(x,y)(x)>(y)?(x):(y)void main(){ int i,j,k; i=
有以下程序段: #include<iostream.h> #define MAX(x,y)(x)>(y)?(x):(y) void main() { int i,j,k; i=10; j=15;k=MAX(i,j)*10; cout<<k<<end1; } 程序执行后的输出结果是( )。A.15B.100C.150D.10
考题
以下程序的输出结果是______。includedefine FUDGE(y)2.84+ydefine PR(A)printf("%d"
以下程序的输出结果是______。 #include<stdio.h> #define FUDGE(y) 2.84+y #define PR(A) printf("%d",(int)(a) ) #define PRINT1(A) PR(a) ;putchar('\n') main() { int x=2; PRINT1(FUDGE(5)*X); }A.11B.12C.13D.15
考题
以下程序的输出结果是______。 include define FUDGE(y)2.84+y define PR(a)printf("
以下程序的输出结果是______。 #include<stdio.h> #define FUDGE(y) 2.84+y #define PR(a) printf("%d",(int)(a)) #define PRINT() PR(s) ;putchar('\n') main() { intx=2; PRINT1 (FUDGE(5)*x); }A.11B.12C.13D.15
考题
有以下程序段:include define MIN(x,y)(x)
有以下程序段:include<iostream.h>define MIN(x,y) (x)<(y)?(x):(y)void main(){int i,j,K;i=10;j=15;k=10*MIN (i,j);cout<<k<<endl;}程序执行后的输出结果是______。
考题
以下程序的输出结果是______。include define FUDGE(y)2.84+ydefine PR(a) printf (
以下程序的输出结果是______。#include <stdio. h>#define FUDGE(y) 2.84+y#define PR(a) printf ("%d",(int)(a))#define PRINT1(a) PR(a); putchar('\n')main(){ int x=2; PRINT1(FUDGE(5)*x);}A.11B.12C.13D.15
考题
下列程序的运行结果是()。includevoid sub(int*s,int*y){static int m=4;*y=s[0];m++;}
下列程序的运行结果是( )。 #include<stdio.h> void sub(int*s,int*y) {static int m=4; *y=s[0]; m++; } void main() {int a[]={1,2,3,4,5},k; int x; printf("\n"); for(k=0;k<=4;k++) {sub(a,x); printf("%d,",x); } }A.1,1,1,1,1,B.1,2,3,4,5,C.0,0,0,0,0,D.4,4,4,4,4,
考题
有如下程序: include using namespace std; class TestClass { private: int x,y; pu
有如下程序: #include<iostream> using namespace std; class TestClass { private: int x,y; public: TestClass (int i,int j) { x=i; y=j; } void print() { cout<<"print1"<<end1; } void print()const { cout<<"print2"<<end1; } }; int main() { const TestClass a(1,2); a.print(); return 0; } 该程序运行后的输出结果是( )。A.print1B.print2C.print1 print2D.程序编译时出错
考题
下面程序的输出结果是 include class example {int a; public: example(int b) {a=
下面程序的输出结果是#include<iostream.h>class example{int a;public:example(int b) {a=b++;}void pnnt( ) {a=a+1;cout < < a < <" ";}void print( ) const{cout < < a < <" ";}};void main( ){example x(3) ;const example y(2) ;x.print( ) ;y.print( ) ;}A.2 2B.4 3C.4 2D.3 2
考题
下列程序的运行结果是()。includevoid sub(int*s,int*y){static int m=4:*y=s[m];m--;}
下列程序的运行结果是( )。 #include<stdio.h> void sub(int*s,int*y) {static int m=4: *y=s[m]; m--; } void main() {int a[]={1,2,3,4,5},k,x; printf("\n"); for(k=0;k<=4;k++) {sub(a,x); printf("%d,",x); } }A.5,4,3,2,1,B.1,2,3,4,5,C.0,0,0,0,0,D.4,4,4,4,4,
考题
有以下程序#include "stdio.h"#define M(x,y) (x)*(y) #define N(x,y) (x)/(y) main(){ int a=5,b=6,c=8,k; k=N(M(a,b),c); printf("%d\n",k);} 程序的运行结果是A.3 B.5C.6 D.8
考题
以下程序的运行结果是()。includedefine MIN(x,y) (x)
以下程序的运行结果是( )。 #include <stdio.h> #define MIN(x,y) (x)<(y)? (x):(y) main() { int i=10,j=15,k; k=10*MIN(i,j); printf("%d\n",k); }A.10B.15C.100D.150
考题
阅读下列程序段,则程序的输出结果为 #include"stdio.h" #define M(X,Y)(X)*(Y) #define N(X,Y)(X)/(Y) main() { int a=5,b=6,c=8,k; k=N(M(a,b),c); printf("%d\n",k);}A.3B.5C.6D.8
考题
有以下程序: include define M 5 define f(x,y) x*y+M main( ) { int k; k=f(2,3)*f(2,3); printf("%d\n",k); } 程序的运行结果是( )。
A.22B.41C.100D.121
考题
以下程序的输出结果是______。includedefine FUDGE(y) 2.84+ydefine PR(a)printf("%d
以下程序的输出结果是______。 #include<stdio.h> #define FUDGE(y) 2.84+y #define PR(a) printf("%d\n",(int)(a)) #define PRINT1(a) PR(a);putchar('\n') main() { int x=2; PRINT1(FUDGE(5)*x); }A.11B.12C.13D.15
考题
下列程序的输出结果是______。includedefine FUDGE(y)2.84+ydefine PR(a)printf("%d"
下列程序的输出结果是______。#include<stdio.h>#define FUDGE(y) 2.84+y#define PR(a) printf("%d",(int)(a))#define PRINTl(a) PR(a);putchar('\n')main (){ int x=2; PRINT1(FUDGE(5)*x);}A.11B.12C.13D.15
考题
有以下程序:include define F(X,Y)(X)*(Y)main(){int a=3,b=4;printf("%d\n",F(a++,b
有以下程序: #include <stdio.h> #define F(X,Y)(X)*(Y) main() { int a=3,b=4; printf("%d\n",F(a++,b++)); } 程序运行后的输出结果是( )。A.12B.15C.16D.20
考题
请选出以下程序段的输出结果 ( )。include using namespace std;define MIN(x,y)(x)
请选出以下程序段的输出结果 ( )。 #include <iostream> using namespace std; #define MIN(x,y) (x)<(y) ?(x) : (y) int main () { int i,j,k; i=10; j=15; k=10*MIN(i,j); cout<<k<<end1; return 0; }A.15B.100C.10D.150
热门标签
最新试卷