Created
August 2, 2015 00:08
-
-
Save batmask/ce3666808ef0debfd911 to your computer and use it in GitHub Desktop.
random sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void ball(){ | |
| static bool isGetSeed = false; | |
| if(!isGetSeed){ | |
| srand((unsigned int)time(NULL)); | |
| isGetSeed = true; | |
| } | |
| int ballNum[6] = {0, }; | |
| for(int i = 0; i < 6; i++){ | |
| int Num = rand()%45 + 1; | |
| ballNum[i] = Num; | |
| for(int j; j < i; j++){ | |
| //편의상 생략 | |
| } | |
| cout << "[" << ballNum[i] << "]"; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment