阅读以下程序:
#include<stdio.h>
mam( )
int case;float printF;
printf("请输入2个数:");
scanf("%d%f",&case,&printf);
printf("%d%f/n",case,printtf);
该程序在编译时产生错误,其出错原因是______。
A:定义语句出错,case是关键字,不能用作用户自定义标识符 B:定义语句出错,printf不能作用户自定义标识符 C:定义语句无错,scanf不能作为输入函数使用 D:定义语句无错,printf不能输出case的值
有如下程序:
#include<iostream>
using namespace std;
class Music
public:
void setTitle(char*str)strcpy(title,str);
protected:
char type[10];
pnvate;
char title[20];
:
class Jazz:public Music
public:
void set(char*str)
strcpy(type,"Jazz");//①
strcpy(title,str);//②
;
下列叙述中正确的是______。
A:程序编译正确 B:程序编译时语句①出错 C:程序编译时语句②出错 D:程序编译时语句①和②都出错
有如下程序:
#include <iostream>
using namespace std;
class Music
public:
void setTitle(char* str) strcpy(title,str);
protected:
char type[10];
private:
char title[20];
;
class Jazz:public Music
public:
void set(char* str)
strcpy(type,"Jazz"); //①
strcpy(title,str); //②
;
下列叙述中正确的是( )。
A:程序编译正确 B:程序编译时语句①出错 C:程序编译时语句②出错 D:程序编译时语句①和②都出错
阅读以下程序:
#include <stdio.h>
main( )
int case;float printF;
printf("请输入2个数:");
scanf("%d%f",&case,&printF);
printf("%d%f/n",case,printF);
该程序在编译时产生错误,其出错原因是
A:定义语句出错,case是关键字,不能用作用户自定义标识符 B:定义语句出错,printF不能用作用户自定义标识符 C:定义语句无错,scanf不能作为输入函数使用 D:定义语句无错,printf不能输出case的值
有如下程序:
#include<iostream>
using namespace std;
class Music
public:
void setTitle(char*str)strcpy(title,str);
protected:
char type[10];
private:
char title[20];
;
class Jazz:public Music
public:
void set(char* str)
strcpy(type,"Jazz"); //①
strcpy(title,str); //②
;
下列叙述中正确的是
A:程序编译正确 B:程序编译时语句①出错 C:程序编译时语句②出错 D:程序编译时语句①和②都出错
阅读以下程序
#include<stdio.h>
main( )
int case; float printF;
printf("请输入2个数:");
scanf("%d %f", &case, &printF);
printf("%d %f/n", case, printF);
该程序编译时产生错误,其出错原因是
A:定义语句出错,case是关键字,不能用作用户自定义标识符 B:定义语句出错,printF不能用作用户自定义标识符 C:定义语句无错,scanf不能作为输入函数使用 D:定义语句无错,printf不能输出case的值
有如下程序:
#include
using namespace std;
class Boat;
class Car{
public:
Car(int i):weight(i){ }
friend int Total(const Car &c.const Boat &b); //①
private:
int weight;
};
class Boat{
public:
Boat(int i):weight(i){ }
friend int Total(const Car &c,const Boat &b);
private:
int weight;
};
int Total(const Car &c,const Boat &b){ //②
return c.weight+b.weight;
}
int main( ){
Car c(10);
Boat b(8);
cout<<"The total weight is"< A:程序编译正确 B:程序编译时语句①出错 C:程序编译时语句②出错 D:程序编译时语句③出错
阅读以下程序
#include
main( )
{int case;float printf;
Printf(“请输入2个数:”);
Scanf(“%d%f”,&case,&printf);
Printf(“%d%f/n”,case,printf);
}
该程序在编译时产生错误,其出错原因是
A:定义语句出错,case是关键字,不能用作用户自定义标示符 B:定义语句出错,printf不能用作用户自定义标示符 C:定义语句出错,scanf不能作为输入函数使用 D:定义语句出错,printf不能输出case的值
有如下程序:
#include
#include
using std::cout;
class Point{
public:
friend double distance(const Point &p); //p距原点的距离
Point(int xx=0,int yy=0):x (xx),Y(YY){}//①
private:
Int x,Y;
};
double distance(const Point &p) { //②
return sqrt(p.x*p.x+p.Y*p.Y);
}
int main(){
Point p1(3,4);
cout< return 0;
}
下列叙述中正确的是()
A:程序编译正确 B:程序编译时语句①出错 C:程序编译时语句②出错 D:程序编译时语句③出错