sleep1 C++ - rand, srand(난수발생), sleep(지연) 콘솔 좌표이동, 색상변경함수(http://topnanis.tistory.com/173)와 함께 자주 사용됩니다. 다음은 0.1초마다 두 자릿수의 랜덤값을 출력하는 소스입니다. rand 혹은 rand 함수는 많은 헤더에 포함되어 있으나 기본은 입니다. #include //rand #include //time #include //sleep, rand//#include //rand using namespace std; int main(){srand(time(NULL));while(true){Sleep(100);//Milliseconds cout 2012. 5. 31. 이전 1 다음