/* --------------------------------------------- 乱数を発生するプログラム rand関数 --------------------------------------------- */ #include #include #include main() { int ransu; /* ------乱数の初期設定------ time(NULL)は現在時刻を秒単位の整数で返す関数 */ srand(time(NULL)); /* ------乱数の生成---------- 乱数の値は0〜32767までの整数 */ ransu = rand(); printf("%d \n",ransu); }