#include <iostream>
using namespace std;
class name1
{
private:
int a;
public:
void function()
{
a=0;
}
void get(int x)
{
a=x;
}
void output()
{
cout<<a<<endl;
}
friend class name2;
};
class name2
{
private:
int b;
public:
void function1()
{
b=0;
}
void get1(name1&x)
{
b=x.a+25;
}
void output1()
{
cout<<b<<endl;
}
};
int main()
{
int c;
name1 ob;
name2 ot;
while(cin>>c)
{
ob.get(c);
ot.get1(ob);
ob.output();
ot.output1();
}
return 0;
}
using namespace std;
class name1
{
private:
int a;
public:
void function()
{
a=0;
}
void get(int x)
{
a=x;
}
void output()
{
cout<<a<<endl;
}
friend class name2;
};
class name2
{
private:
int b;
public:
void function1()
{
b=0;
}
void get1(name1&x)
{
b=x.a+25;
}
void output1()
{
cout<<b<<endl;
}
};
int main()
{
int c;
name1 ob;
name2 ot;
while(cin>>c)
{
ob.get(c);
ot.get1(ob);
ob.output();
ot.output1();
}
return 0;
}
No comments:
Post a Comment