-
实验二
实验一 点击查看代码 #include <stdio.h> #include <stdlib.h> #include <time.h> #define N 5 #define N1 80 #define N2 35 int main() { int cnt; int random_major, ra -
实验2
实验任务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_majo -
实验作业2
实验1: 点击查看代码 #include <stdio.h> #include <stdlib.h> #include <time.h> #define N 5 #define N1 80 #define N2 35 int main () { int cnt; int random_major, -
实验2
实验任务1 代码 #include<stdio.h> #include<stdlib.h> #include<time.h> #define N 5 #define N1 80 #define N2 35 int main() { int cnt; int random_major, random_ -
实验1 现代C++编程初体验
task1.cpp reverse修改原始序列,reverse_copy不修改; rotate算法可以将元素移动到序列的另一个位置,first代表移动的起始位置。middle代表中间位置,last代表结束位置 #include <iostream> #include <vector> #includ -
实验2
任务1 问题1:生成一个随机数 问题2:生成一个随机学号 任务2 问题1:会把上次运行的结果加进去 问题2:继续循环 任务3 #include <stdio.h> int main() { char ch; while ((ch = getchar()) != EOF) { if (ch == '\ -
实验一
实验任务1: 源代码: 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <algorithm> 5 6 // 模板函数声明 7 template<typename T> 8 void output(co -
实验1 现代C++基础编程
任务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); 7 -
实验1
代码1 #include<iostream> #include<string> #include<vector> #include<algorithm> template<typename T> void output(const T &c); void test1(); void test2(); -
实验1 现代C++编程初体验
实验任务1: task1源代码: 1 #include<iostream> 2 #include<string> 3 #include<vector> 4 #include<algorithm> 5 6 //模板函数声明 7 template<typename T> 8 void output(co -
实验2
实验任务1 源代码 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <time.h> 4 5 #define N 5 6 #define N1 30 7 #define N2 35 8 9 int main() 10 { 11 int cn -
实验2
试验任务1 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 ran -
实验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