会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
zh-ang-zhang
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
34
35
36
37
38
2023年4月20日
C++每日打卡
摘要: 求两点之间距离 定义一个Point类,有两个数据成员:x和y, 分别代表x坐标和y坐标,并有若干成员函数。定义一个函数Distance(), 用于求两点之间的距离。 #include<iostream>#include<math.h>#include<iomanip>using namespace
阅读全文
posted @ 2023-04-20 12:55 涨涨涨张
阅读(23)
评论(0)
推荐(0)
2023年4月19日
C++每日打卡
摘要: 创建CPU 定义一个CPU类,包含等级(Rank)、频率(frequency)、电压(voltage)等属性。其中,rank为枚举类型CPU__Rank,定义为enum CPU_Rank{P1=1,P2,P3,P4,P5,P6,P7},frequency为单位是MHz的整型数,voltage为浮点型
阅读全文
posted @ 2023-04-19 18:40 涨涨涨张
阅读(27)
评论(0)
推荐(0)
2023年4月18日
C++每日打卡
摘要: 定义一个Tree(树)类,有成员ages(树龄),不带参数的构造函数对ages初始化为1,成员函数grow(int years)对ages加上years,age()显示tree对象的ages的值。 #include <iostream>using namespace std; class Tree
阅读全文
posted @ 2023-04-18 21:19 涨涨涨张
阅读(39)
评论(0)
推荐(0)
2023年4月17日
C++每日打卡
摘要: 计算长方形面积和表面积 第一个函数计算长方形的面积,其中x和y是长和宽。第二个函数计算长方体的表面积,x,y和z是长,宽和高。 #include<iostream>#include<string>using namespace std;int area(int x,int y){ int a; a=
阅读全文
posted @ 2023-04-17 18:43 涨涨涨张
阅读(22)
评论(0)
推荐(0)
2023年4月14日
C++第四天
摘要: 定义一个CPU类,包含等级(Rank)、频率(frequency)、电压(voltage)等属性。其中,rank为枚举类型CPU__Rank,定义为enum CPU_Rank{P1=1,P2,P3,P4,P5,P6,P7},frequency为单位是MHz的整型数,voltage为浮点型的电压值。
阅读全文
posted @ 2023-04-14 19:29 涨涨涨张
阅读(34)
评论(0)
推荐(0)
2023年4月12日
C++第三天
摘要: 定义并实现一个矩形类,有长和宽两个属性,由成员函数计算矩形的面积。 #include <iostream>using namespace std; void Rectangle::setLength(int l) { length=l; } void Rectangle::setWidth(int
阅读全文
posted @ 2023-04-12 21:10 涨涨涨张
阅读(20)
评论(0)
推荐(0)
2023年4月11日
C++第二天
摘要: 计算正五边形的周长和面积 #include <bits/stdc++.h>using namespace std;int main(){ double n,S,C; double a,b; cin>>n; a=sqrt(5); b=25+10*a; S=sqrt(b)/4*n*n; cout<<S<
阅读全文
posted @ 2023-04-11 20:11 涨涨涨张
阅读(20)
评论(0)
推荐(0)
2023年4月10日
C++第一天
摘要: 简单的C++程序实例 #include<iostream> using namespace std; int main() { cout<<"hello!"<<endl; cout<<"welcom to C++!"<<endl; return 0; } 输出: Hello! welcome to
阅读全文
posted @ 2023-04-10 21:08 涨涨涨张
阅读(13)
评论(0)
推荐(0)
上一页
1
···
34
35
36
37
38
公告