2022年11月30日
摘要: 6.3 #include <iostream> #include <fstream> #include <array> #define N 5 void test1(){ using namespace std; array<int, N> x{ 97, 98, 99, 100, 101 }; of 阅读全文
posted @ 2022-11-30 20:44 都说了没有名字 阅读(15) 评论(0) 推荐(0) 编辑
2022年11月24日
摘要: 实验5.4 #include <iostream> #include "Pets.hpp" using namespace std; void play(MachinePets& obj) { std::cout << obj.get_nickname() << " says " << obj.ta 阅读全文
posted @ 2022-11-24 19:20 都说了没有名字 阅读(15) 评论(0) 推荐(0) 编辑
2022年11月3日
摘要: 实验4.5 #pragma once #include<iostream> using namespace std; class vectorInt { friend void output(vectorInt&v); public: vectorInt(int n); vectorInt(int 阅读全文
posted @ 2022-11-03 17:48 都说了没有名字 阅读(18) 评论(0) 推荐(0) 编辑
2022年10月19日
摘要: 实验3.5 #pragma once #include<iostream> #include<iomanip> using namespace std; class Info { public: Info() {}; Info(string nickname0, string contact0, s 阅读全文
posted @ 2022-10-19 21:41 都说了没有名字 阅读(20) 评论(0) 推荐(0) 编辑
2022年10月15日
摘要: 实验2.1 #include <iostream> #include <complex> int main() { using namespace std; complex<double> c1{ 3, 4 }, c2{ 4.5 }; const complex<double> c3{ c2 }; 阅读全文
posted @ 2022-10-15 20:01 都说了没有名字 阅读(21) 评论(0) 推荐(0) 编辑
2022年9月28日
摘要: #include<iostream> using std::cout; using std::endl; class Point{ public: Point(int x0=0,int y0=0); Point(const Point& p); ~Point()=default; int get_x 阅读全文
posted @ 2022-09-28 18:47 都说了没有名字 阅读(27) 评论(0) 推荐(0) 编辑
2021年12月30日
摘要: #include <stdio.h> #define N 5 // 定义结构体类型struct student,并定义STU为其别名 typedef struct student { long no; char name[20]; int score; } STU; // 函数声明 void inp 阅读全文
posted @ 2021-12-30 10:16 都说了没有名字 阅读(21) 评论(1) 推荐(0) 编辑
2021年12月15日
摘要: 实验1 #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; printf( 阅读全文
posted @ 2021-12-15 13:58 都说了没有名字 阅读(22) 评论(0) 推荐(0) 编辑
2021年12月9日
摘要: 实验1.1 #include<stdio.h> #define N 5 void output(int x[],int n) { int i; for (i = 0; i < n; i++) printf("%d ", x[i]); printf("\n"); } int main() { int 阅读全文
posted @ 2021-12-09 21:04 都说了没有名字 阅读(21) 评论(0) 推荐(0) 编辑
2021年12月2日
摘要: 实验1.1 #include<stdio.h> const int N=4; int main() { int a[N] = { 2,0,2,1 }; char b[N] = { '2','0','2','1' }; int i; printf("sizeof(int)=%d\n", sizeof( 阅读全文
posted @ 2021-12-02 17:10 都说了没有名字 阅读(27) 评论(0) 推荐(0) 编辑