0
点赞
收藏
分享

微信扫一扫

程序填空_8

悄然丝语 2022-06-08 阅读 119

源程序:

要求输出结果为40

#include <iostream>
using namespace std;class Test
{
static int x; //程序填空
public:
Test(int i=0)
{
x=i+x;
}
int Getnum()
{
return Test::x+10;
}
};
int Test::x=30; //程序填空
void main()
{
Test test;
cout<<test.Getnum()<<endl;
}

举报

相关推荐

0 条评论