上一页 1 ··· 35 36 37 38 39 40 41 42 43 ··· 76 下一页
摘要: void Util::thread14(int x,int y,string str) { thread t1([](int xx,int yy,string sstr) { Util ul; for(int i=0;i<xx;i++) { cout<<"Num= "<<i<<","<<ul.get 阅读全文
posted @ 2022-04-10 13:42 FredGrit 阅读(28) 评论(0) 推荐(0) 编辑
摘要: #include "Model/Util.h" char *Util::uuidValue = (char *)malloc(40); void Util::threadLambda6(int xx,int yy,string sstr) { thread t1([](int x,int y,str 阅读全文
posted @ 2022-04-04 16:15 FredGrit 阅读(21) 评论(0) 推荐(0) 编辑
摘要: void thread28(int num,string sstr) { thread t([](int x,string str) { printNumUuid26(); printUuidNum27(); printUuid30(x); printUuid31(str); },num,sstr) 阅读全文
posted @ 2022-04-03 19:01 FredGrit 阅读(31) 评论(0) 推荐(0) 编辑
摘要: void printArray17(int *arr, int len) { for (int i = 0; i < len; i++) { cout << arr[i] << "\t"; } cout << endl << endl; } void getArray16(int *arr, int 阅读全文
posted @ 2022-04-03 13:36 FredGrit 阅读(26) 评论(0) 推荐(0) 编辑
摘要: //Utility.h #ifndef Utility_H #define Utility_H #include <ctime> #include <iostream> #include <thread> #include <unistd.h> #include <uuid/uuid.h> usin 阅读全文
posted @ 2022-03-22 15:54 FredGrit 阅读(83) 评论(0) 推荐(0) 编辑
摘要: void Util::arrayAsc61(int len) { stringstream ss; int *arr = new int[len]; getArray23(arr, len); chrono::time_point<chrono::system_clock> startTime; c 阅读全文
posted @ 2022-03-20 14:44 FredGrit 阅读(76) 评论(0) 推荐(0) 编辑
摘要: Original as below via recursion and will call the method itself for many times which is inefficient int Util::factorial54(int i) { if(i==0 ||i==1) { r 阅读全文
posted @ 2022-03-19 20:38 FredGrit 阅读(16) 评论(0) 推荐(0) 编辑
摘要: void Util::fib53(int *arr, int num, int &result) { arr[0]=0; arr[1]=1; for(int i=2;i<=num;i++) { arr[i]=arr[i-2]+arr[i-1]; } for(int i=0;i<=num;i++) { 阅读全文
posted @ 2022-03-19 20:21 FredGrit 阅读(18) 评论(0) 推荐(0) 编辑
摘要: void Util::getArray23(int *arr, int len) { srand(time(NULL)); for (int i = 0; i < len; i++) { arr[i] = rand(); } } void Util::printArray24(int *arr, i 阅读全文
posted @ 2022-03-19 19:14 FredGrit 阅读(31) 评论(0) 推荐(0) 编辑
摘要: void Util::logFile21(string fileName) { fstream wFile(fileName, ios::app); if (!wFile.is_open()) { cout << "Create or open " << fileName << " failed!" 阅读全文
posted @ 2022-03-19 18:04 FredGrit 阅读(34) 评论(0) 推荐(0) 编辑
上一页 1 ··· 35 36 37 38 39 40 41 42 43 ··· 76 下一页