-
实验2
1.问题一:如果没有这行代码srand(time(NULL)),rand 生成的随机数序列会是固定的,失去了 “随机” 的意义。 问题二:随机生成学号 2.问题一:total_price = 0; 去掉会使上一次购买金额加到此次上 问题二:continue语义,在该次程序运行中用户输入不满足if() -
实验一 现代C++编程初体验
task1: 源代码: #include<iostream> #include<string> #include<vector> #include<algorithm> template<typename T> void output(const T &c); void test1(); void -
作业二
task1 1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<time.h> 4 5 #define N 5 6 #define N1 80 7 #define N2 35 8 9 int main(){ 10 int cnt; 11 int r -
实验一
1.实验任务1 task1.cpp: // 现代C++标准库、算法库体验 // 本例用到以下内容: // 1. 字符串string, 动态数组容器类vector、迭代器 // 2. 算法库:反转元素次序、旋转元素 // 3. 函数模板、const引用作为形参 #include <iostream> -
实验一
实验任务1 #include <iostream> #include <string> #include <vector> #include <algorithm> template<typename T> void output(const T &c); void test1(); void te -
实验一
1.实验任务1 源代码task1.cpp 1 #include <iostream> 2 #include<string> 3 #include<vector> 4 #include<algorithm> 5 template<typename T> 6 void output(const T &c -
实验任务2
task1.c 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <time.h> 4 #define N 5 5 #define N1 80 6 #define N2 35 7 int main() { 8 int cnt; 9 int r -
实验1
#include<iostream> #include<string> #include<vector> #include<algorithm> template<typename T> void output(const T &c); void test1(); void test2(); voi -
实验1 现代C++编程初体验
#实验任务1 ##代码 ```c++ 1 #include<iostream> 2 #include<vector> 3 #include<string> 4 #include<algorithm>//提供各类通用算法,涵盖排序、查找、修改、比较等操作 5 6 template<typename T -
实验1
任务1: 源代码: 1 // 现代C++标准库、算法库体验 2 // 本例用到以下内容: 3 // 1. 字符串string, 动态数组容器类vector、迭代器 4 // 2. 算法库:反转元素次序、旋转元素 5 // 3. 函数模板、const引用作为形参 6 7 #include <iostr -
实验1 现代C++编程初体验
实验任务一: 源代码task1.cpp: #include<iostream> #include<string> #include<vector> #include<algorithm> template<typename T> void output(const T&c); void test1( -
OOP实验一
OOP面向对象の学习 -
实验1 现代C++编程初体验
实验任务1 程序源代码: #include <iostream> #include <string> #include <vector> #include <algorithm> template<typename T> void output(const T& c); void test1(); -
实验1 现代C++编程初体验
任务1: 源代码task1.cpp 1 //现代C++标准库、算法库体验 2 //本例用到以下内容: 3 // 1.字符串string,动态数组容器类vector、迭代器 4 // 2.算法库:反转元素次序、旋转元素 5 // 3.函数模板、const引用作为形参 6 7 #include<iost -
实验1 现代C++基础编程
任务1 源代码 1 #include<iostream> 2 #include<string> 3 #include<vector> 4 #include<algorithm> 5 6 template<typename T> 7 void output(const T &C); 8 9 void -
实验1 现代C++基础编程
实验任务1: 问题一:reverse直接将s1反转,反转后结果存到s1本身,reverse_copy则是将s1反转后的结果存在s2,s1自身不变 问题二:rotate 算法通过将容器中 [first,middle) 区间的元素移到[middle,last)之后,实现元素循环移位 first:旋转范围 -
实验一
实验一 task1 (1) 1 // 现代C++标准库、算法库体验 2 // 本例用到以下内容: 3 // 1.字符串string, 动态数组容器类vector、迭代器 4 // 2.算法库:反转元素次序、旋转元素 5 // 3.函数模板、const引用作为形参 6 7 #include<iostr -
oop实验一
实验一: task1: 源代码: 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <algorithm> 5 6 template<typename T> 7 void output(const T & -
实验1 现代C++编程初体验
任务一 源代码 #include <iostream> #include <string> #include <vector> #include <algorithm> // 模板函数声明 template<typename T> void output(const T &c); void test -
实验2
1.实验任务1 task1.c 点击查看代码 #include<stdio.h> #include<stdlib.h> #include<time.h> #define N 5 #define N1 80 #define N2 35 int main(){ int cnt; int random_m