Sprinkler in C++