U E D R , A S I H C RSS

데블스캠프2003/Toy Problems/Random

.

~cpp 
#include <iostream> //  iostream  .
#include <ctime> // time(0)   .
using namespace std;

int main()
{
    srand(time(0)); // rand()  .
                    //     . -_-;;
    int x = rand(); // rand()    .
                    //    0 ~    .
    int x1 = rand() % 10; // % 10   x1  10    
                          // 0 ~ 9 까  .
    int x2 = rand() % 9 + 1; // % 9  0~8까   고
                            // 거기 1  1~9 까  .
    return 0;
}


rand() % a + b b ~ a+b . ( 1da + b . )
b - ..그=ㅂ=;;

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:28:56
Processing time 0.0082 sec