c++封装

#include<bits/stdc++.h>
using namespace std;
class yuan
{
public:
//属性
int t;
//行为
int f()
{
return t*t;
}
};
int main()
{
yuan c1;
c1.t=3;
cout<<c1.f()<<endl;
return 0;
}

posted @   夜深人静写算法  阅读(4)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术
· .NET周刊【3月第1期 2025-03-02】
点击右上角即可分享
微信分享提示