会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
姜振晖
博客园
首页
新随笔
联系
订阅
管理
2021年12月12日
实验5 模板类与多态
摘要: 实验任务2 Person.hpp #ifndef PERSON_HPP #define PERSON_HPP #include<iomanip> #include<iostream> #include<string> using namespace std; class Person{ public
阅读全文
posted @ 2021-12-12 20:28 姜振晖
阅读(48)
评论(3)
推荐(0)
2021年11月28日
实验4
摘要: 实验任务2 #include <iostream> #include <typeinfo> // definitation of Graph class Graph { public: virtual void draw() { std::cout << "Graph::draw() : just
阅读全文
posted @ 2021-11-28 11:49 姜振晖
阅读(45)
评论(3)
推荐(0)
2021年11月4日
实验3
摘要: 实验任务四 #ifndef VECTOR_INT_H #define VECTOR_INT_H #include<iostream> using namespace std; class vector_int{ public: vector_int(int n,int a=0); vector_in
阅读全文
posted @ 2021-11-04 16:39 姜振晖
阅读(33)
评论(3)
推荐(0)
2021年10月27日
实验二
摘要: #ifndef INFO_HPP #define INFO_HPP #include<iostream> #include<string> #include<vector> using namespace std; class info{ public: info(string a,string b
阅读全文
posted @ 2021-10-27 15:46 姜振晖
阅读(81)
评论(3)
推荐(0)
2021年10月26日
实验2
摘要: #ifndef INFO_HPP #define INFO_HPP #include<iostream> #include<string> #include<vector> using namespace std; class info{ public: info(string a,string b
阅读全文
posted @ 2021-10-26 18:15 姜振晖
阅读(21)
评论(0)
推荐(0)
2021年10月22日
实验一
摘要: 实验任务三 #ifndef COMPLEX_HPP #define COMPLEX_HPP #include <iostream> #include<cmath> using namespace std; class Complex { public: Complex():real(0),imag(
阅读全文
posted @ 2021-10-22 20:37 姜振晖
阅读(27)
评论(4)
推荐(0)
2020年12月27日
实验7
摘要: 试验任务3 是按分数由高到低的顺序排列,生成了文本文件file3.data,由记事本打开,顺序正确,直观可读。 实验任务4 正确输出了数据,生成了二进制文件,由记事本打开,顺序正确,不直观可读。 #include<stdio.h> #include<stdlib.h> #define N 10 ty
阅读全文
posted @ 2020-12-27 23:58 姜振晖
阅读(83)
评论(1)
推荐(0)
2020年12月18日
实验6
摘要: 试验任务1: // P280例8.15 // 对教材上的程序作了微调整,把输出学生信息单独编写成一个函数模块 // 打印不及格学生信息和所有学生信息程分别调用 #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 3 //
阅读全文
posted @ 2020-12-18 00:01 姜振晖
阅读(83)
评论(1)
推荐(0)
2020年12月11日
实验5
摘要: 实验任务1 #include <stdio.h> const int N=3; int main() { int a[N] = {1, 2, 3}; int i; printf("通过数组名及下标直接访问数组元素:\n"); for(i=0; i<N; i++) printf("%d: %d\n",
阅读全文
posted @ 2020-12-11 00:41 姜振晖
阅读(89)
评论(1)
推荐(0)
2020年11月28日
实验4
摘要: 实验任务1: 不能,应为函数只能返回一个值。 实验任务2: #include <stdio.h> long long fac(int n); int main() { int i,n; printf("Enter n: "); scanf("%d", &n); for(i=1; i<=n; ++i)
阅读全文
posted @ 2020-11-28 22:06 姜振晖
阅读(139)
评论(1)
推荐(0)
下一页
公告