会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
nuist0415
博客园
首页
新随笔
联系
管理
订阅
2024年12月17日
实验6 模板类、文件I/O和异常处理
摘要: task4 Vector.hpp 1 #pragma once 2 3 #include <iostream> 4 #include <stdexcept> 5 6 using std::cout; 7 using std::endl; 8 9 template<typename T> 10 cla
阅读全文
posted @ 2024-12-17 18:44 Haruto
阅读(9)
评论(0)
推荐(0)
2024年12月4日
实验5 继承和多态
摘要: task3 pets.hpp 1 #pragma once 2 3 using std::string; 4 using std::cout; 5 using std::endl; 6 7 class MachinePets { 8 public: 9 MachinePets(const strin
阅读全文
posted @ 2024-12-04 17:02 Haruto
阅读(28)
评论(0)
推荐(0)
2024年11月23日
实验4 类的组合、继承、模板类、标准库
摘要: Task2 GradeClac.cpp 1 #include <iostream> //派生类定义、访问 2 #include <vector> 3 #include <string> 4 #include <algorithm> 5 #include <numeric> 6 #include <i
阅读全文
posted @ 2024-11-23 18:25 Haruto
阅读(29)
评论(0)
推荐(0)
2024年11月5日
实验3 类和对象_基础编程2
摘要: Task1 button.hpp 1 #pragma once 2 3 #include <iostream> 4 #include <string> 5 6 using std::string; 7 using std::cout; 8 9 // 按钮类 10 class Button { 11
阅读全文
posted @ 2024-11-05 20:14 Haruto
阅读(15)
评论(0)
推荐(0)
2024年10月23日
实验2 类和对象_基础编程1
摘要: Task1 t.h 1 #pragma once 2 3 #include <string> 4 5 // 类T: 声明 6 class T { 7 // 对象属性、方法 8 public: 9 T(int x = 0, int y = 0); // 普通构造函数 10 T(const T& t);
阅读全文
posted @ 2024-10-23 21:09 Haruto
阅读(38)
评论(0)
推荐(0)
2024年10月13日
实验1 现代C++编程初体验
摘要: Task1 code1.cpp 1 // 现代C++标准库、算法库体验 2 // 本例用到以下内容: 3 // 1. 字符串string, 动态数组容器类vector、迭代器 4 // 2. 算法库:反转元素次序、旋转元素 5 // 3. 函数模板、const引用作为形参 6 7 #include
阅读全文
posted @ 2024-10-13 14:09 Haruto
阅读(30)
评论(0)
推荐(0)
2023年12月16日
实验七
摘要: task4 code 1 #include<stdio.h> 2 3 int main() { 4 FILE* fp; 5 long cnt = 0, c = 0; 6 char ch; 7 8 fp = fopen("data4.txt", "r"); 9 if (fp == NULL) { 10
阅读全文
posted @ 2023-12-16 21:07 Haruto
阅读(15)
评论(0)
推荐(0)
2023年12月11日
实验六
摘要: task4 code 1 #include <stdio.h> 2 #define N 10 3 4 typedef struct { 5 char isbn[20]; // isbn号 6 char name[80]; // 书名 7 char author[80]; // 作者 8 double
阅读全文
posted @ 2023-12-11 19:07 Haruto
阅读(15)
评论(1)
推荐(0)
2023年11月27日
实验五
摘要: task1_1 code 1 #define _CRT_SECURE_NO_WARNINGS 2 3 #include <stdio.h> 4 #define N 5 5 void input(int x[], int n); 6 void output(int x[], int n); 7 voi
阅读全文
posted @ 2023-11-27 19:04 Haruto
阅读(16)
评论(0)
推荐(0)
2023年11月13日
实验四
摘要: task1_1 code 1 #define _CRT_SECURE_NO_WARNINGS 2 #include <stdio.h> 3 #define N 4 4 void test1() { 5 int a[N] = { 1, 9, 8, 4 }; 6 int i; 7 // 输出数组a占用的
阅读全文
posted @ 2023-11-13 19:59 Haruto
阅读(18)
评论(0)
推荐(0)
下一页