摘要: 实验任务2 Person.hpp #ifndef PERSON_H #define PERSON_H #include <iostream> #include <iomanip> #include <string> using std::cout; using std::cin; using std 阅读全文
posted @ 2021-12-12 17:29 软饭弟弟 阅读(13) 评论(2) 推荐(0) 编辑
摘要: 任务2 task2.cpp #include <iostream> #include <typeinfo> // definitation of Graph class Graph { public: void draw() { std::cout << "Graph::draw() : just 阅读全文
posted @ 2021-11-28 13:12 软饭弟弟 阅读(28) 评论(3) 推荐(0) 编辑
摘要: 实验任务4 vector_int.hpp #ifndef VECTOR_INT_HPP #define VECTOR_INT_HPP #include<iostream> using namespace std; class vector_int { public: vector_int(int n 阅读全文
posted @ 2021-11-07 16:26 软饭弟弟 阅读(15) 评论(3) 推荐(0) 编辑
摘要: 五 #include <iostream> #include <string> using namespace std; class Info { public: Info (string nina, string con, string ci, int num = 0): nickname(nin 阅读全文
posted @ 2021-10-31 11:56 软饭弟弟 阅读(16) 评论(3) 推荐(0) 编辑
摘要: 实验3: Complex.h #ifndef COMPLEX_HPP #define COMPLEX_HPP #include<iostream> #include<cmath> using namespace std; class Complex { private: double real,im 阅读全文
posted @ 2021-10-24 14:07 软饭弟弟 阅读(24) 评论(5) 推荐(0) 编辑
摘要: 实验任务3 正确,生成 正确,直观可读 实验任务4 子任务1:正确输出,生成,不直观可读 子任务2: #include <stdio.h> #include <stdlib.h> #define N 10 typedef struct student { int num; char name[20] 阅读全文
posted @ 2020-12-27 19:35 软饭弟弟 阅读(54) 评论(2) 推荐(0) 编辑
摘要: // P280例8.15 // 对教材上的程序作了微调整,把输出学生信息单独编写成一个函数模块 // 打印不及格学生信息和所有学生信息程分别调用 #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 3 // 运行程序输入 阅读全文
posted @ 2020-12-20 15:00 软饭弟弟 阅读(33) 评论(0) 推荐(0) 编辑
摘要: #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", &a[i] 阅读全文
posted @ 2020-12-15 22:27 软饭弟弟 阅读(35) 评论(1) 推荐(0) 编辑
摘要: 实验任务1:这个应用中,一元二次方程的根,不能设计成以函数返回值的方式返回给主调函数。 实验任务2: #include <stdio.h> long long fac(int n); // 函数声明 int main() { int i,n; printf("Enter n: "); scanf(" 阅读全文
posted @ 2020-11-29 17:45 软饭弟弟 阅读(34) 评论(1) 推荐(0) 编辑
摘要: #include <math.h> #include <stdio.h> int main() { float a, b, c, x1, x2; float delta, real, imag; printf("Enter a, b, c: "); while(scanf("%f%f%f", &a, 阅读全文
posted @ 2020-11-15 15:28 软饭弟弟 阅读(86) 评论(1) 推荐(0) 编辑