阅读下列程序,写出运行结果:
#include<iostream> using namespace std; class A { public : int f1(); int f2(); void setx( int m ) { x = m; cout << x << endl; } void sety( int n ) { y = n; cout << y << endl; } int getx() { return x; } int gety() { return y; } private : int x, y; }; int A::f1() { return x + y; } int A::f2() { return x - y; } int main() { A a; a.setx( 10 ); a.sety( 5 ); cout << a.getx() << '\t' << a.gety() << endl; cout << a.f1() << '\t' << a.f2() << endl; }