I tried some solves that system("pause") / adding getcha() but none of them worked.
#include <iostream>
using namespace std;
int main() {
cout << "hello world" << endl;
return 0;
}
What should I do?
Your code is most definitely valid. The reason it's shutting down is just the way Code::Blocks is set up.
You can follow the instructions here to make the console stay open after executing the program.