Skip to content

Instantly share code, notes, and snippets.

@batmask
Created August 2, 2015 00:08
Show Gist options
  • Select an option

  • Save batmask/ce3666808ef0debfd911 to your computer and use it in GitHub Desktop.

Select an option

Save batmask/ce3666808ef0debfd911 to your computer and use it in GitHub Desktop.
random sample
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