网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
有如下类和对象的定义:class MyHello{public:static string getName() { return "Hello"; }};MyHello my;下列各组语句中,能输出“Hello”的是( )。

A. cout<

B.cout<

C.cout<

D.cout<


参考答案

更多 “ 有如下类和对象的定义:class MyHello{public:static string getName() { return "Hello"; }};MyHello my;下列各组语句中,能输出“Hello”的是( )。 A. coutB.coutC.coutD.cout ” 相关考题
考题 有如下类和对象的定义: class Constants{ public: static double getPI( ){return 3.1416;} }; Constants constants; 下列各组语句中,能输出3.1416的是A.cout<<constants->getPI( );和cout<<Constants::getPI( );B.cout<<constants.getPI( );和cout<<Constants.getPI( );C.cout<<constants->getPI( );和cout<<Constants->getPI( );D.cout<<eonstants.getPI( );和cout<<Constants::getPI( );

考题 下列程序的输出结果是()。includeusing namespace std;int main(){char a[]="Hello,Te 下列程序的输出结果是( )。 #include<iostream> using namespace std; int main() { char a[]="Hello,Test"; char *p=a; while(*p) { if(*p>='a'*p<='’z') cout<<char(*p+'A'-'a'); else cout<<*p; p++; } return 0; }A.hello,testB.Hello,TestC.HELLO,TESTD.hELLO,tEST

考题 有如下类和对象的定义: class Constants{ public: static double get PI(){return 3.1416;} }; Constants constants; 下列各组语句中,能输出3.1416的是A.cout<<constants->getPI();和cout<<Constants::getPI();B.cout<<constants. getPI();和cout<<Constants.getPI();C.cout<<constants->getPI();和cout<<Constants->getPl();D.cout<<constants. getPI();和cout<<Constants::getPI();

考题 有如下类和对象的定义: class Constants{ public: static double getPI{return 3.1416;} }; Constants constants: 下列各组语句中,能输出3.1416的是( )。A.coutconstants一getPI;和coutConstants::getPI;B.coutconstants.getPI;和coutConstants.getPI;C.coutconstants一getPI;和coutConstants一getPI;D.coutconstants.getPI;和coutConstants::getPI;

考题 下列程序的输出结果是 include usingnamespacestd; int main () {chara []="Hello,W 下列程序的输出结果是 #include <iostream> using namespace std; int main () { char a [] = "Hello,World": char*ptr = a; while (*ptr) { if(*ptr>= 'a' *ptr <='z' cout<<char{*ptr+'A'-'a'); else cout<<*ptr; ptr++; } return 0; }A. HELLO. WORLDB. Hello, WorldC. hELLO, wORLDD. hello, world

考题 对于下列Hello类,哪个叙述是正确的? class Hello{ Hello(int m){ } int Hello() { return 20; } hello() {} }A.Hello类有2个构造方法B.Hello类的int Hello()方法是错误的方法C.Hello类没有构造方法D.Hello无法通过编译,因为其中的hello方法的方法头是错误的(没有返回类型)。

考题 对于下列Hello类,哪个叙述是正确的? class Hello { Hello(int m){ } int Hello() { return 20; } hello() { } }A.Hello无法通过编译,因为其中的hello方法的方法头是错误的(没有类型)。B.Hello类没有构造方法。C.Hello类的int Hello()方法是错误的方法。D.Hello类有2个构造方法。

考题 下列定义字符串类string对象的语句中,错误的是()。A.string str;B.string str(“Hello, world” );C.string str = “Hello, world”;D.string str = ‘Hello, world’;

考题 对于下列Hello类,哪个叙述是正确的? class Hello{ Hello(int m){ } int Hello(){ return 30; } hello(){ } }A.Hello类有两个构造方法B.Hello类的int Hello()方法是错误的方法C.Hello类没有构造方法D.Hello无法通过编译,因为 其中的hello方法的方法头是错误的(没有类型)