摘要: 实验任务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 姜振晖 阅读(37) 评论(3) 推荐(0) 编辑
摘要: 实验任务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 姜振晖 阅读(30) 评论(3) 推荐(0) 编辑
摘要: 实验任务四 #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 姜振晖 阅读(27) 评论(3) 推荐(0) 编辑
摘要: #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 姜振晖 阅读(68) 评论(3) 推荐(0) 编辑
摘要: #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 姜振晖 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 实验任务三 #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 姜振晖 阅读(14) 评论(4) 推荐(0) 编辑
摘要: 试验任务3 是按分数由高到低的顺序排列,生成了文本文件file3.data,由记事本打开,顺序正确,直观可读。 实验任务4 正确输出了数据,生成了二进制文件,由记事本打开,顺序正确,不直观可读。 #include<stdio.h> #include<stdlib.h> #define N 10 ty 阅读全文
posted @ 2020-12-27 23:58 姜振晖 阅读(75) 评论(1) 推荐(0) 编辑
摘要: 试验任务1: // P280例8.15 // 对教材上的程序作了微调整,把输出学生信息单独编写成一个函数模块 // 打印不及格学生信息和所有学生信息程分别调用 #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 3 // 阅读全文
posted @ 2020-12-18 00:01 姜振晖 阅读(62) 评论(1) 推荐(0) 编辑
摘要: 实验任务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 姜振晖 阅读(84) 评论(1) 推荐(0) 编辑
摘要: 实验任务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 姜振晖 阅读(126) 评论(1) 推荐(0) 编辑