会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
wyhzmd
博客园
首页
新随笔
联系
订阅
管理
2024年12月23日
实验6 模板类、文件I/O及异常处理
摘要: 实验任务4 Vector.hpp 1 #include<iostream> 2 #include<stdexcept> 3 4 using namespace std; 5 6 template<typename T> 7 class Vector{ 8 private: 9 int size; 1
阅读全文
posted @ 2024-12-23 08:44 张朦丹
阅读(35)
评论(0)
推荐(0)
2024年12月22日
实验7 文件应用编程
摘要: 实验任务4 1 #include <stdio.h> 2 #include <stdlib.h> 3 4 int main() { 5 FILE *fp; 6 char ch; 7 int lines = 0, characters = 0; 8 9 fp = fopen("data4.txt",
阅读全文
posted @ 2024-12-22 23:29 张朦丹
阅读(23)
评论(0)
推荐(0)
2024年12月16日
实验六 C语言结构体、枚举应用编程
摘要: 实验任务1 task1.c 1 // P286例8.17 2 // 对教材示例代码作了微调,把输出学生信息单独编写成一个函数模块 3 // 打印不及格学生信息、打印所有学生信息均调用该模块实现 4 5 #include <stdio.h> 6 #include <string.h> 7 #defin
阅读全文
posted @ 2024-12-16 12:37 张朦丹
阅读(27)
评论(0)
推荐(0)
2024年12月8日
实验5 继承和多态
摘要: 实验任务1 publisher.hpp 1 #pragma once 2 3 #include <iostream> 4 #include <string> 5 6 using std::cout; 7 using std::endl; 8 using std::string; 9 10 // 发行
阅读全文
posted @ 2024-12-08 11:42 张朦丹
阅读(11)
评论(0)
推荐(0)
2024年12月7日
实验5 c语言指针应用编程
摘要: 实验任务1 task1_1.c 1 #include <stdio.h> 2 #define N 5 3 4 void input(int x[], int n); 5 void output(int x[], int n); 6 void find_min_max(int x[], int n,
阅读全文
posted @ 2024-12-07 16:18 张朦丹
阅读(45)
评论(0)
推荐(0)
2024年11月24日
实验四 类的组合、继承、模板类、标准库
摘要: 实验任务一 task1_1.cpp 1 #include <iostream> 2 3 using std::cout; 4 using std::endl; 5 6 // 类A的定义 7 class A { 8 public: 9 A(int x0, int y0); 10 void displa
阅读全文
posted @ 2024-11-24 16:14 张朦丹
阅读(15)
评论(0)
推荐(0)
2024年11月8日
实验3 类和对象
摘要: 实验任务1 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-08 16:54 张朦丹
阅读(7)
评论(0)
推荐(0)
实验4 c语言数组应用编程
摘要: 实验任务1 task1.c 1 #include <stdio.h> 2 #define N 4 3 #define M 2 4 5 void test1() { 6 int x[N] = {1, 9, 8, 4}; 7 int i; 8 9 // 输出数组x占用的内存字节数 10 printf("
阅读全文
posted @ 2024-11-08 10:39 张朦丹
阅读(14)
评论(0)
推荐(0)
2024年10月28日
实验2 类与对象
摘要: 实验任务一 t.h 1 // 类T: 声明 2 class T { 3 // 对象属性、方法 4 public: 5 T(int x = 0, int y = 0); // 普通构造函数 6 T(const T &t); // 复制构造函数 7 T(T &&t); // 移动构造函数 8 ~T();
阅读全文
posted @ 2024-10-28 23:14 张朦丹
阅读(21)
评论(0)
推荐(0)
2024年10月26日
实验3 c语言函数应用编程
摘要: 实验任务1 task1.c 1 #include <stdio.h> 2 3 char score_to_grade(int score); // 函数声明 4 5 int main() { 6 int score; 7 char grade; 8 9 while(scanf("%d", &scor
阅读全文
posted @ 2024-10-26 20:04 张朦丹
阅读(82)
评论(0)
推荐(0)
下一页
公告