online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. *******************************************************************************/ #include <iostream> #include <random> using namespace std; int getRandomNumber (int min, int max) { // μ”¨λ“œ μ„€μ • random_device rd; mt19937 seed(rd()); //뢄포 μ„€μ • uniform_int_distribution<int> range(min, max); //랜덀 κ°’ 생성 return range(seed); } int main() { const int MIN = 1; const int MAX = 45; int arr[MAX+1]; int pickedBall; // μ΄ˆκΈ°ν™” μž‘μ—… for (int i=MIN; i<=MAX; i=i+1) { arr[i] = 0; } // 총 7개의 수λ₯Ό λ½‘μŒ for (int i=1; i<=7; i++) { while(true) { pickedBall = getRandomNumber(MIN, MAX); if (arr[pickedBall]==0) { // 이전에 λ½‘μ•˜λŠ”μ§€ 확인 break; // 뽑은 적이 μ—†λ‹€λ©΄ OK } } if (i==7) { cout << " (BONUS: " << pickedBall << ")" << endl; } else { arr[pickedBall] = 1; // λ½‘μ•˜λ‹€κ³  ν‘œμ‹œ cout << pickedBall << " "; } } return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue