C++实验7 #include <iostream>using namespace std;class Complex {public: double real; double imag; Complex(double r = 0, double i = 0); void print(); Complex operator+(Complex c); Complex operator*(Complex c);};Complex::Complex(dou.
实验6.1 #include <iostream>#include<string>using namespace std;class MyArray {public: MyArray(int length); ~MyArray(); void Input(); void Display(string);protected: int* alist; int length;};MyArray::MyArray(int leng){ .
5.1实验 #include <iostream>using namespace std;class Base {public: void setx(int i) { x = i; } int getx() { return x; }public: int x;};class Derived :public Base {public: void sety(int i) { .
【无标题】 #include "fun.h"int main(){ student A, B, C; A.ExpendMoney(-50); A.ShowMoney(); B.ExpendMoney(-98.5); C.ExpendMoney(-500.53);}fun.h#pragma once#include <iostream>using namespace std;class student {public: void InitSt.
【无标题】 #include <iostream>using namespace std;class Ctest { static int count;public: Ctest() { ++count; cout << "对象数量=" << count << ''; }};int Ctest::count = 0;int main(void){ Ctest a[3]; retur.
【无标题】 #include <iostream>using namespace std;class Tr {public: Tr(int n) { i = n; } void set_i(int n) { i = n; } int get_i() { return i; }private: int i;};void sqr_it(Tr&ob){ o.
【无标题】 main.cpp#include"fun.h"void main() { Score a, b(5); a.Input(); a.Show(); a.paixvA(); a.paixvB(); a.paixvC();}fun.h#pragma once#include<iostream>using namespace std;class Score {public: Score(); Score(int a); ~Score() {}; void Inp.
2021-11-14 主函数#include "fun.h"int main(){ A x; x.input(); x.show(); x.showavg(); A y(5); y.input(); y.show(); y.showavg(); return 0;}源1#include "fun.h"A::A() { b = 2;}A::A(int b1) { b = b1;}void A::input() {...