摘要:
1. 實驗任務4 Vector.hpp源代碼 1 #pragma once 2 #include <iostream> 3 #include <stdexcept> 4 using namespace std; 5 6 template <typename T> 7 class Vector { 8
閱讀全文
posted @ 2024-12-24 14:58
陳少秋
閱讀(11)
推薦(0)
摘要:
實驗任務三 源碼如下: 1 #pragma once 2 #include<iostream> 3 #include<string> 4 using std::string; 5 using std::cout; 6 using std::endl; 7 class MachinePets { 8
閱讀全文
posted @ 2024-12-09 12:17
陳少秋
閱讀(9)
推薦(0)
摘要:
實驗任務2: GradeCalc.hpp task2.cpp 運行測試截圖: 問題1: 成績存儲位置:成績存儲在`GradeCalc`類的一個`vector<int>`成員變量中。由于`GradeCalc`是從`std::vector<int>`派生的,因此它可以使用`std::vector<int
閱讀全文
posted @ 2024-11-25 15:40
陳少秋
閱讀(13)
推薦(0)
摘要:
實驗任務1: 實驗代碼: button.hpp: #pragma once #include <iostream> #include <string> using std::string; using std::cout; // 按鈕類 class Button { public: Button(c
閱讀全文
posted @ 2024-11-11 15:41
陳少秋
閱讀(18)
推薦(0)
摘要:
實驗任務1 task1.cpp: View Code 運行測試截圖: 實驗任務2 task2.cpp: View Code 運行測試截圖: 實驗任務3 task3.cpp: #include <iostream> #include <string> #include <algorithm> bool
閱讀全文
posted @ 2024-10-16 00:43
陳少秋
閱讀(40)
推薦(0)
摘要:
實驗任務4 1 #pragma once 2 #include <iostream> 3 #include <stdexcept> 4 5 template <class T> 6 class Vector { 7 private: 8 T* data; 9 size_t size; 10 11 p
閱讀全文
posted @ 2023-12-18 01:22
陳少秋
閱讀(23)
推薦(0)
摘要:
實驗任務5: TextCoder.hpp文件源碼: 1 #ifndef TEXTCODER_HPP 2 #define TEXTCODER_HPP 3 4 #include <string> 5 6 class TextCoder { 7 private: 8 std::string text; 9
閱讀全文
posted @ 2023-12-01 01:51
陳少秋
閱讀(18)
推薦(0)
摘要:
任務1: 1 #pragma once 2 3 #include <iostream> 4 using std::cout; 5 using std::endl; 6 7 class Point { 8 public: 9 Point(int x0 = 0, int y0 = 0); 10 ~Poi
閱讀全文
posted @ 2023-11-06 03:56
陳少秋
閱讀(15)
推薦(0)
摘要:
任務三: 1 #ifndef T_HPP 2 #define T_HPP 3 4 #include <iostream> 5 #include <cmath> 6 7 class Complex { 8 private: 9 double real; // 實部 10 double imag; //
閱讀全文
posted @ 2023-10-23 01:17
陳少秋
閱讀(18)
推薦(0)
摘要:
實驗任務1 task1.cpp: 1 // 標準庫string, vector, array基礎用法 2 #include <iostream> 3 #include <string> 4 #include <vector> 5 #include <array> 6 // 函數模板 7 // 對滿足
閱讀全文
posted @ 2023-10-19 22:32
陳少秋
閱讀(19)
推薦(0)