#include static const int nlmax = 2; int main(int argc, char *argv[]) { int more=1; int nlcount=0; while (more) { char c; cin.read(&c,1); if (cin.eof() || !cin.good()) break; if (c == '\n') { if (++nlcount > nlmax) continue; } else { nlcount=0; } cout.write(&c,1); } return 0; }