有以下程序:
#include <iostream>
using namespace std;
class sampleprivate:
int x;
static int y;
public:
sample(int a);
static void print(sample s);
;
sample:: sample(int a) x=a;
y+=x;void sample:: print(sample s) cout<<"x="<<s. x<<",y="<<y<<end1;int sample:: y=0;
int main() sample s1(10);
sample s2(20);
sample:: print(s2);
return 0;程序运行后的输出结果是( )。
A.x=10,y=20
B.x=20,y=30
C.x=30,y=20
D.x=30,y=30