隱藏置頂帖
置頂
本站站規
文章管理:
以下條文涵蓋會員名稱、頭像、簽名檔、文章標題以及其文章內容等展示個人思想、意見等媒體。至於觸犯條文之嚴重程度及其處理方式,將由其版主依據該版之版規判斷並予以執行後續處置。至於各版之版規及其規範內容,不得與下列條文衝突,否則該規定將不擁有任何效力。
1. 本論壇嚴禁未滿18歲者發佈色情、恐怖、 ...
使用Windows thread 設計多執行緒 Quick sort
**** 本內容被作者隱藏 ****原數列:
41 67 34 0 69 24 78 58 62 64 5 45 81 27 61 91 95 42 27 36
排序後:
0 5 24 27 27 34 36 41 42 45 58 61 62 64 67 69 78 81 91 95
使用Windows mutex 與 semaphore 解決Sleeping-Barber問題
**** 本內容被作者隱藏 ****
輸出結果
Customer waits: seat = 2
Barber cutting: seat = 3
Customer waits: seat = 2
Barber cutting: seat = 3
Customer waits: seat = 2
Barber cutting: seat = 3
Customer waits: seat = 2
Barber cutting: seat = 3
Customer waits: seat = 2
Barber cutting: seat = 3
Customer waits ...
使用Windows mutex 與semaphore 練習有限緩衝區問題
**** 本內容被作者隱藏 ****
輸出結果
+:1 0 0 0 0
-:0 0 0 0 0
+:1 0 0 0 0
-:0 0 0 0 0
+:1 0 0 0 0
-:0 0 0 0 0
+:1 0 0 0 0
+:1 1 0 0 0
-:1 0 0 0 0
+:1 1 0 0 0
+:1 1 1 0 0
-:1 1 0 0 0
+:1 1 1 0 0
-:1 1 0 0 0
+:1 1 1 0 0
+:1 1 1 1 0
+:1 1 1 1 1
-:1 1 1 1 0
CreateThread
Windows 的基本 API 只要含入 即可__in 代表輸入參數
__out 代表輸出參數 (就是有可能在函式內被修改, 呼叫前後值有可能會改變的參數)
這個函式的最簡單用法是:
CreateThread(NULL, 0, pfnThread, (LPVOID)lpParam, 0 NULL);
也就是只指定第三跟第四個參數, 第三個參數是一個函式指標, 第四個參數是該函式的參數
函式 ...
快速排序法
猜數字(?A?B)
猜猜我猜猜
猜數字
...................
#include
using namespace std;
struct person{
int age ;
float weight,height;
char bloodtype;
};
person Mary;
int main()
{
coutMary.age;
cin>>Mary.bloodtype;
cout ...
動態記憶體 列陣求總和
陣列 最大小值
簡易數據交換
簡易字元陣列
簡易多維矩陣
簡單陣列
階層
#include
using namespace std ;
long double foct(int a)
{if(a==1)
return 1;
else return(a+foct(a-1));}
int main()
{
int x;
while(true){
cout
算正方體面積
#include
using namespace std ;
#define cube(x) x*x*x
int main()
{int a;
couta;
cout
次方
#include
using namespace std ;
double pow(double x,double y);
int main()
{
cout
根號
#include
using namespace std ;
double sqrt(double x);
int main()
{
cout
輸入兩數 判斷大小