online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> #include <fstream> #include <algorithm> struct city { int x, y; }; int main() { std::ifstream in("harta.in"); if (!in.is_open()) { std::cout << "No harta! Ty otchislen!\n"; return 0; } int n, m, k; in >> n >> m >> k; city * cities = new city[k]; for (int c = 0; c < k; ++c) in >> cities[c].x >> cities[c].y; for (int i = 0; i < n; ++i) { for (int j = 0; j < m; ++j) { bool on_city = std::find_if(cities, cities + k, [i, j](const city& c) { return c.x == i && c.y == j; }) != cities + k; std::cout << (on_city ? '*' : '.'); } std::cout << "\n"; } delete [] cities; return 0; }
5 5 3 4 2 0 3 1 4

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