摘要:
#include<iostream> #include<ctime> using namespace std; #define number_i 3 #define number_j 3 int **get_disorder_arr() { //生成二维数组的指针 int **arr=new int 阅读全文
摘要:
int a = 1; int b = 2; int c = 3; 这里的时间复杂度为O(1); for(i = 1; i <= n; i++) { j = i; j++; } 这里的时间复杂度为O(n); int i = 1; while(i < n) { i = i * 2; } 这里的时间复杂度 阅读全文
摘要:
#include<iostream> #include<ctime> using namespace std; #define number 10 int main() { srand((unsigned int)time(NULL)); int arr[number]; int flag=0; / 阅读全文
摘要:
假定一组随机数,然后快速找到第num位置的数 #include<iostream> #include<ctime> using namespace std; #define number 10 #define num 7 int main() { srand((unsigned int)time(N 阅读全文
摘要:
//买小鸡程序 #include<stdio.h> #include<math.h> #include<windows.h> using namespace std; void buy() { int cock=0; int hen=0; int child_chicken=0; int numbe 阅读全文
摘要:
#include<iostream> using namespace std; int main() { srand((unsigned int)time(NULL)); int number; number=rand()%100; //生成0~99的数字; int guess_number; in 阅读全文
摘要:
#include<iostream> #include<iomanip> using namespace std; int main() { int flower; int ten; int hundred; int number; int flag=0; for (int i = 1; i < 1 阅读全文