#include <iostream>
using namespace std;
class cat{
int age ;
int weight ;
public:
void set(int x, int y);
int f() ;
cat(int age);
~cat();
};
cat::cat(int x){
age = x;
}
cat::~cat(){
}
int cat::f(){
return age;
}
void cat::set(int x, int y){
age = x;
weight = y;
}
int main()
{
cat v(22);
cout << v.f() << endl;
v.set(10, 20);
cout << v.f() << endl;
return 0;
}
C++
最新推荐文章于 2022-12-19 09:37:41 发布