2006-02-13から1日間の記事一覧

pthreads (2) 超基本から

pth

pthreadsまとめ。まずは基本から。 #include <stdio.h> #include <unistd.h> #include <pthread.h> #define THREADSNUM 5 void func(int *); int main(void){ pthread_t thread[THREADSNUM]; int i; for(i=0; i</pthread.h></unistd.h></stdio.h>

トランプと確率の問題

ネタ元 http://www.nyasoku.com/archives/50352203.html ジョーカーを除いたトランプ52枚の中から1枚のカードを抜き出し、表を見ないで箱の中にしまった。そして、残りのカードをよく切ってから3枚抜き出したところ、3枚ともダイアであった。このとき、…