摘要:
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 阅读全文
摘要:
实验5.4 #include <iostream> #include "Pets.hpp" using namespace std; void play(MachinePets& obj) { std::cout << obj.get_nickname() << " says " << obj.ta 阅读全文
摘要:
实验4.5 #pragma once #include<iostream> using namespace std; class vectorInt { friend void output(vectorInt&v); public: vectorInt(int n); vectorInt(int 阅读全文
摘要:
实验3.5 #pragma once #include<iostream> #include<iomanip> using namespace std; class Info { public: Info() {}; Info(string nickname0, string contact0, s 阅读全文
摘要:
实验2.1 #include <iostream> #include <complex> int main() { using namespace std; complex<double> c1{ 3, 4 }, c2{ 4.5 }; const complex<double> c3{ c2 }; 阅读全文
摘要:
#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 阅读全文
摘要:
#include <stdio.h> #define N 5 // 定义结构体类型struct student,并定义STU为其别名 typedef struct student { long no; char name[20]; int score; } STU; // 函数声明 void inp 阅读全文
摘要:
实验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( 阅读全文
摘要:
实验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 阅读全文