摘要: #include<iostream> #include<fstream> #include<iomanip> using namespace std; void test() { ofstream out; out.open("cipher_ke.txt"); if (!out.is_open()) 阅读全文
posted @ 2022-11-30 13:23 姜安童 阅读(35) 评论(0) 推荐(0) 编辑
摘要: pets.h #pragma once #include <iostream> using namespace std; class MachinePets { public: MachinePets(){} MachinePets(const string s):nickname(s){} ~Ma 阅读全文
posted @ 2022-11-26 10:19 姜安童 阅读(18) 评论(0) 推荐(0) 编辑
摘要: #pragma once #include <iostream> using namespace std; class vectorInt { public: vectorInt(int n); vectorInt(int n, int value); vectorInt(vectorInt& x) 阅读全文
posted @ 2022-11-04 15:56 姜安童 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 头文件: #pragma once #include <iostream> using namespace std; class TextCoder { public: TextCoder(); TextCoder(string a):text{a}{} string get_ciphertext( 阅读全文
posted @ 2022-10-20 16:23 姜安童 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 头文件: #pragma once #include<iostream> #include<math.h> using namespace std; class Complex { public: Complex() :real{ 0 }, imag{ 0 }{} ~Complex() {} Com 阅读全文
posted @ 2022-10-15 09:03 姜安童 阅读(25) 评论(0) 推荐(0) 编辑
摘要: 实验一: #include <iostream> #include <string> #include <vector> int main() { using namespace std; string s1; string s2{ "c plus plus" }; string s3{ s2 }; 阅读全文
posted @ 2022-09-30 15:52 姜安童 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 恢复内容开始 #include <stdio.h> #define N 5 // 定义结构体类型struct student,并定义STU为其别名 typedef struct student { long no; char name[20]; int score; } STU; // 函数声明 v 阅读全文
posted @ 2021-12-30 22:41 姜安童 阅读(80) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #define N 5 int binarySearch(int* x, int n, int item); // 函数声明 int main() { int a[N] = { 2, 7, 19, 45, 66 }; int i, index, key; pri 阅读全文
posted @ 2021-12-15 22:07 姜安童 阅读(40) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #define N 5 void output(int x[], int n); int main() { int x[N] = { 9, 55, 30, 27, 22 }; int i; int k; // 用于记录最大元素的下标 int t; // 用作交换 阅读全文
posted @ 2021-12-10 21:23 姜安童 阅读(33) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> const int N = 4; int main() { int a[N] = { 2, 0, 2, 1 }; char b[N] = { '2', '0', '1', '1' }; int i; printf("sizeof(int) = %d\n", si 阅读全文
posted @ 2021-12-02 20:55 姜安童 阅读(30) 评论(0) 推荐(0) 编辑