摘要:
task3_1.cpp #include <iostream> #include <fstream> #include <array> #define N 5 int main() { using namespace std; array<int, N> x {97, 98, 99, 100, 10 阅读全文
摘要:
task 4 '''pets.hpp''' #pragma once using namespace std; #include <iostream> class MachinePets { friend void play(MachinePets &obj); public: MachinePet 阅读全文
摘要:
task 5 vectorInt.hpp #pragma once #include <iostream> using namespace std; class vectorInt { public: vectorInt (int n) { cout << "constructor 2 called 阅读全文
摘要:
## 实验五 ### info.hpp #pragma once #include <iostream> using namespace std; class Info{ public: Info(string name,string cont,string city,int n){ this->n 阅读全文
摘要:
task 4 Complex.hpp #pragma once #include <iostream> #include <cmath> using namespace std; class Complex { friend Complex add(const Complex &c1, const 阅读全文
摘要:
任务二 // Point类 // 相较于教材,在构造函数的写法上,采用了业界更通用的初始化列表方式 #include <iostream> using std::cout; using std::endl; // 定义Point类 class Point { public: Point(int x0 阅读全文
摘要:
task 1 1.2004 2.2001 3.指针指向类型不同,前者指向int型,++p加 sizeof(int)=4 task 2 1.2004 2004 2.2001 2001 task 3 1.sizeof 计算实际分配的内存数,包含'\0' strlen计算字符个数不包含\0 2.不可以 3 阅读全文
摘要:
task 1 // 将图书信息写入文本文件data1.txt #include <stdio.h> #define N 5 #define M 80 typedef struct { char name[M]; // 书名 char author[M]; // 作者 } Book; int main 阅读全文
摘要:
task 1 #include <stdio.h> #define N 4 int main() { int a[N] = {2, 0, 2, 2}; char b[N] = {'2', '0', '2', '2'}; int i; printf("sizeof(int)=%d\n", sizeof 阅读全文
摘要:
11111111111 #include <stdio.h> #include <stdlib.h> #include <time.h> #include <windows.h> #define N 80 void printText(int line, int col, char text[]); 阅读全文