假定有如下程序:
#include <iostream>
using namespace std;
int s =0;
class example
static int n;
public:
example(int i)
n=i;

static void add( )
s+=n;

;
int example::n=0;
int main( )
example a(2),b(5);
example::add( );
cout<<s<<endl;
return 0;

程序运行后输出结果为( )。

题库:计算机等级考试 类型:最佳选择题 时间:2017-07-03 15:13:03 免费下载:《单项选择》Word试卷

假定有如下程序:
#include <iostream>
using namespace std;
int s =0;
class example
static int n;
public:
example(int i)
n=i;

static void add( )
s+=n;

;
int example::n=0;
int main( )
example a(2),b(5);
example::add( );
cout<<s<<endl;
return 0;

程序运行后输出结果为( )。
A.2
B.3
C.7
D.5

假定有如下程序:  #include <iostream>  using namespace std;  int s =0;  class example

本题关键词:固定程序控制器,国家标准制定程序,程序,下肢假肢,既定顺序,假定坐标网,假定位体征,假定工作面,安全生产标准制定程序,有序镜检;

微信扫码获取答案解析
下载APP查看答案解析