- 博客(8)
- 收藏
- 关注
原创 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
1088
原创 实验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
607
原创 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
128
原创 【无标题】
#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.
2021-11-29 00:01:45
402
原创 【无标题】
#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
172
原创 【无标题】
#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
185
原创 【无标题】
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
771
原创 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() {...
2021-11-14 20:36:44
409
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅