会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
yanmao
博客园
首页
新随笔
联系
订阅
管理
2023年12月17日
实验6 模板类、文件I/O和异常处理
摘要: Task4: vector.hpp: #include<iostream> #include<string> #include<stdexcept> using namespace std; template <typename T> class Vector { private: T* data;
阅读全文
posted @ 2023-12-17 20:30 煙猫
阅读(19)
评论(0)
推荐(0)
2023年12月3日
实验五 继承和多态
摘要: Task 3:pets.hpp: #include<iostream> #include<string> using namespace std; class MachinePets{ public: MachinePets(const string s):nickname(s){} const s
阅读全文
posted @ 2023-12-03 22:08 煙猫
阅读(22)
评论(0)
推荐(0)
2023年11月30日
现代C++标准库与类模板
摘要: Task 5: textcoder.cpp: #include<iostream> #include<string> class TextCoder{ private: std::string text; void encoder(string &a){ for(int i=0;i < a.leng
阅读全文
posted @ 2023-11-30 23:02 煙猫
阅读(18)
评论(0)
推荐(0)
2023年11月5日
实验三 类与数组,指针
摘要: Task1: point.hpp: #pragma once #include <iostream> using std::cout; using std::endl; class Point { public: Point(int x0 = 0, int y0 = 0); ~Point() = d
阅读全文
posted @ 2023-11-05 22:57 煙猫
阅读(12)
评论(0)
推荐(0)
2023年10月22日
实验二 类与对象
摘要: Task 3: Complex.cpp: #include <iostream> #include <cmath> class Complex{ public: Complex (double r=0,double i=0){ real = r; imag = i; } Complex (const
阅读全文
posted @ 2023-10-22 23:59 煙猫
阅读(14)
评论(0)
推荐(0)
2023年10月19日
实验一 类与对象
摘要: Task 1: #include<iostream> #include<string> #include<vector> #include<array> template<typename T> void output1(const T &obj){ for (auto i: obj) std::c
阅读全文
posted @ 2023-10-19 22:47 煙猫
阅读(18)
评论(0)
推荐(0)
公告