-
实验二
任务一: T.h 1 #pragma once 2 #include <string> 3 // 类T: 声明 4 class T { 5 // 对象属性、方法 6 public: 7 T(int x = 0, int y = 0); // 普通构造函数 8 T(const T &t); // 复制 -
oop-实验2
task1 T.h 1 #pragma 2 3 #include<string> 4 5 class T{ 6 public: 7 T(int x=0,int y=0); 8 T(const T &t); 9 T(T &&t); 10 ~T(); 11 12 void adjust(int rati -
实验二
实验任务1 源代码 T.cpp #include "T.h" #include <iostream> #include <string> // 类T实现 // static成员数据类外初始化 const std::string T::doc{"a simple class sample"}; con -
实验二
实验任务一 T.h源码 #pragma once #include <string> class T { public: T(int x = 0, int y = 0); T(const T &t); T(T &&t); ~T(); void adjust(int ratio); void disp -
实验二
task1 T.h #pragma once #include <string> // 类T: 声明 class T { // 对象属性、方法 public: T(int x = 0, int y = 0); // 普通构造函数 T(const T& t); // 复制构造函数 T(T&& t); -
现代C++编程初体验
##实验任务1 ##代码 #pragma once #include <string> // 类T: 声明 class T { // 对象属性、方法 public: T(int x = 0, int y = 0); // 普通构造函数 T(const T &t); // 复制构造函数 T(T &&t -
实验3
task1 点击查看代码 #include <stdio.h> char score_to_grade(int score); int main() { int score; char grade; while(scanf("%d", &score) != EOF) { grade = score_ -
实验二
task1: 代码组织: T.h 内容:类T的声明、友元函数声明 T.cpp 内容:类T的实现、友元函数实现 task1.cpp 内容:测试模块、main函数 T.h : #pragma once #include <string> // 类T: 声明class T { // 对象属性、方法 pub -
实验3
实验任务1 代码 #include <stdio.h> char score_to_grade(int score); int main() { int score; char grade; while(scanf("%d", &score) != EOF) { grade = score_to_g -
实验2 现代C++编程初体验
1. 实验任务1 T.h 1 #pragma once 2 3 #include <string> 4 5 // 类T: 声明 6 class T { 7 // 对象属性、方法 8 public: 9 T(int x = 0, int y = 0); // 普通构造函数 10 T(const T & -
实验二
#任务一 ##1.源代码 1.T.h #pragma once #include <string> // 类T: 声明 class T { // 对象属性、 方法 public: T(int x = 0, int y = 0); T(const T &t); T(T &&t); // 移动构造函数 -
实验2
任务1: #include "T.h" #include <iostream> void test_T(); int main() { std::cout << "test Class T: \n"; test_T(); std::cout << "\ntest friend func: \n"; -
实验2
实验任务1源代码: 1 #pragma once 2 #include <string> 3 // 类T: 声明 4 class T { 5 // 对象属性、方法 6 public: 7 T(int x = 0, int y = 0); // 普通构造函数 8 T(const T& t); // 复 -
实验二
1.#pragma once #include<string> //类T:声明 class T { //对象属性、方法 public: T(int x = 0, int y = 0);//普通构造函数 T(const T& t);//复制构造函数 T(T &&t); //移动构造函数 ~T(); v -
实验2
task1: 源代码T.h 1 #pragma once 2 3 #include <string> 4 5 // 类T: 声明 6 class T { 7 // 对象属性、方法 8 public: 9 T(int x = 0, int y = 0); // 普通构造函数 10 T(const T -
实验3
实验任务1 task1.c 点击查看代码 #include <stdio.h> char score_to_grade(int score); int main() { int score; char grade; while (scanf("%d", &score) != EOF) { grade -
实验2
#任务1 ##代码 ###T.h 1 #pragma once 2 3 #include <string> 4 5 // 类T: 声明 6 class T { 7 // 对象属性、方法 8 public: 9 T(int x = 0, int y = 0); // 普通构造函数 10 T(const -
实验2
任务1: 源代码: 1 #pragma once 2 3 #include <string> 4 5 // 类T: 声明 6 class T { 7 // 对象属性、方法 8 public: 9 T(int x = 0, int y = 0); // 普通构造函数 10 T(const T &t); -
实验2
实验二: 实验1 源代码: T.h 1 #pragma once 2 3 #include <string> 4 5 // 类T: 声明 6 class T { 7 // 对象属性、方法 8 public: 9 T(int x = 0, int y = 0); // 普通构造函数 10 T(cons -
实验2
实验2 实验任务一 : 代码组织: T.h 内容:类T的声明、友元函数声明 T.cpp 内容:类T的实现、友元函数实现 task1.cpp 内容:测试模块、main函数 T.h: #include <string> // 类T: 声明 class T { // 对象属性、方法 public: T(i