>>350
もう少しC++流にやるなら
 srand(static_cast<unsigned>(time(NULL)));