摘要:
实验任务2 Person.hpp #ifndef PERSON_H #define PERSON_H #include <iostream> #include <iomanip> #include <string> using std::cout; using std::cin; using std 阅读全文
摘要:
任务2 task2.cpp #include <iostream> #include <typeinfo> // definitation of Graph class Graph { public: void draw() { std::cout << "Graph::draw() : just 阅读全文
摘要:
实验任务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 阅读全文
摘要:
五 #include <iostream> #include <string> using namespace std; class Info { public: Info (string nina, string con, string ci, int num = 0): nickname(nin 阅读全文
摘要:
实验3: Complex.h #ifndef COMPLEX_HPP #define COMPLEX_HPP #include<iostream> #include<cmath> using namespace std; class Complex { private: double real,im 阅读全文
摘要:
实验任务3 正确,生成 正确,直观可读 实验任务4 子任务1:正确输出,生成,不直观可读 子任务2: #include <stdio.h> #include <stdlib.h> #define N 10 typedef struct student { int num; char name[20] 阅读全文
摘要:
// P280例8.15 // 对教材上的程序作了微调整,把输出学生信息单独编写成一个函数模块 // 打印不及格学生信息和所有学生信息程分别调用 #include<stdio.h> #include<stdlib.h> #include<string.h> #define N 3 // 运行程序输入 阅读全文
摘要:
#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] 阅读全文
摘要:
实验任务1:这个应用中,一元二次方程的根,不能设计成以函数返回值的方式返回给主调函数。 实验任务2: #include <stdio.h> long long fac(int n); // 函数声明 int main() { int i,n; printf("Enter n: "); scanf(" 阅读全文
摘要:
#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, 阅读全文