有如下程序:
#include<iostream>
#include<string>
using namespace std;
class MyBag
public:
MyBag(string br,string cr):brand( br), color(cr)++count;
~MyBag( )--count;
static int GetCount( ) return count;
pnvate:
string brand,color;
static int count;
;
int main( )
MyBag one("CityLife","Gray"),two("Micky","Red");
cout<<MyBag::CetCount( );
return 0;
若程序运行时的输出结果为2,则横线处缺失的语句是______。
题库:计算机等级考试
类型:最佳选择题
时间:2017-07-03 14:15:45
免费下载:《简单单选》Word试卷
有如下程序:
#include<iostream>
#include<string>
using namespace std;
class MyBag
public:
MyBag(string br,string cr):brand( br), color(cr)++count;
~MyBag( )--count;
static int GetCount( ) return count;
pnvate:
string brand,color;
static int count;
;
int main( )
MyBag one("CityLife","Gray"),two("Micky","Red");
cout<<MyBag::CetCount( );
return 0;
若程序运行时的输出结果为2,则横线处缺失的语句是______。
A.int count=0;
B.static int count=0;
C.int MyBag::count=0;
D.static int MyBag::count=0;
本题关键词:程序,有序镜检,工程施工程序,复苏程序,工作程序,建设程序,程序变更,程序冲突,点火程序,生产程序;