#include #include using namespace std; char command[1024]; int main(int argc, char const *argv[]) { ofstream ofs; ofs.open("main.rb",ios::binary); string buf; string splitter="<$><*><$>"; string time; while(getline(cin,buf)){ if(buf==splitter)break; ofs<>time; system(("timeout -s 9 " + time + " /opt/wandbox/ruby-head/bin/ruby main.rb < test.in").c_str()); return 0; }