online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
// SITUVNgcd // daynhauhoc.com/t/122558 #include<iostream> #include<thread> #include<chrono> #include<string> using namespace std; int main(){ int sl = 3; // sleeptime string str; // str int e = 0; // exit int fl, i = 0; // flag, increasing thread t; // thread while(!e){ t = thread([&](){ int id = i; fl = 0; this_thread::sleep_for(chrono::seconds(sl)); if(id == i){ fl = 1; cout << "Hey timeout!" << endl; } }); t.detach(); cin >> str; i++; if(fl){ cout << "You're late!" << endl; }else{ cout << "So quick!" << endl; } if(str == "e"){ cout << "What? You leave me? Bye!" << endl; e = 1; } } 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