摘要: task2: person.h: #ifndef UNTITLED22_PERSON_H #define UNTITLED22_PERSON_H #include<iostream> #include<string> using namespace std; class Person { priva 阅读全文
posted @ 2021-12-11 12:48 沈超超 阅读(30) 评论(3) 推荐(0) 编辑
摘要: task2: 程序源码: #include <iostream> #include <typeinfo> // definitation of Graph class Graph { public: void draw() { std::cout << "Graph::draw() : just a 阅读全文
posted @ 2021-11-24 23:08 沈超超 阅读(43) 评论(3) 推荐(0) 编辑
摘要: 实验任务四: vector_int.h: #ifndef UNTITLED15_VECTOR_INT_H #define UNTITLED15_VECTOR_INT_H #include "iostream" using namespace std; class Vector_int { priva 阅读全文
posted @ 2021-11-08 21:10 沈超超 阅读(11) 评论(3) 推荐(0) 编辑
摘要: 实验任务五: info.cpp源文件: #ifndef UNTITLED11_INFO_H #define UNTITLED11_INFO_H #include<iostream> #include<vector> #include<string> using namespace std; clas 阅读全文
posted @ 2021-10-31 13:24 沈超超 阅读(41) 评论(3) 推荐(1) 编辑
摘要: 实验任务三: Complex.hpp文件源码: #ifndef UNTITLED8_COMPLEX_H#define UNTITLED8_COMPLEX_H#include<iostream>#include<string>#include<math.h>using namespace std;cl 阅读全文
posted @ 2021-10-23 13:04 沈超超 阅读(18) 评论(3) 推荐(0) 编辑
摘要: 1.已自主验证,当前路径下生成了file3.txt,已将file1.txt中小写字母改为大写字母。 2.已自主验证。 3.屏幕上正确输出了按分数由高到低的信息,生成了file3.txt,可用记事本打开,数据信息正确,且直观可读。 4.子任务1正确输出信息,生成了二进制文件file4.dat,信息无法 阅读全文
posted @ 2020-12-29 08:45 沈超超 阅读(61) 评论(1) 推荐(0) 编辑
摘要: #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 3 typedef struct student{ int id; char name[20]; char subject[20]; float perf; float 阅读全文
posted @ 2020-12-20 00:46 沈超超 阅读(70) 评论(1) 推荐(0) 编辑
摘要: ex1. #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-14 17:49 沈超超 阅读(56) 评论(1) 推荐(0) 编辑
摘要: ex1.return只能返回一个值,所以不能把多个根返回给主调函数。 ex2 #include<stdio.h> long long fac(int n); int main() { int i,n; printf("Enter n:"); scanf("%d",&n); for(i=1;i<=n; 阅读全文
posted @ 2020-11-29 22:20 沈超超 阅读(69) 评论(1) 推荐(0) 编辑
摘要: #include<stdio.h> #include<math.h> int main() { float a,b,c,x1,x2; float delta,real,imag; printf("Enter a,b,c: "); while(scanf("%f%f%f",&a,&b,&c)!=EOF 阅读全文
posted @ 2020-11-14 22:25 沈超超 阅读(77) 评论(1) 推荐(0) 编辑