http://www.yuyak.com/1339 を見て、Cによるsleep sortの実装がないのもどうかと思ったので書いてみた。シンプルですな。 #include <assert.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> int main(int argc, char** argv) { int values[] = { 1, 9, 5, 3 }; int i; for (i = 0; i < sizeof(values) / sizeof(values[0]); i++) switch (fork()) { case -1: assert(0); break; case 0: /* child process */ sleep(values[i]); printf