笔记
博览369
这个作者很懒,什么都没留下…
展开
-
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.原创 2021-12-19 23:22:40 · 1012 阅读 · 0 评论 -
实验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) { .原创 2021-12-13 01:18:05 · 564 阅读 · 0 评论 -
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) { .原创 2021-12-11 23:42:26 · 70 阅读 · 0 评论 -
【无标题】
#include <iostream> using namespace std; class Ctest { static int count; public: Ctest() { ++count; cout << "对象数量=" << count << '\n'; } }; int Ctest::count = 0; int main(void) { Ctest a[3]; retur.原创 2021-11-28 23:57:52 · 135 阅读 · 0 评论 -
【无标题】
#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.原创 2021-11-28 23:52:54 · 150 阅读 · 0 评论 -
【无标题】
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-21 23:49:07 · 725 阅读 · 0 评论