程序填空_8

阅读 119

2022-06-08

源程序:

要求输出结果为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)

0 0 举报