源程序:
要求输出结果为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;
}