Department of Computer Science | Institute of Theoretical Computer Science | CADMO

Theory of Combinatorial Algorithms

Prof. Emo Welzl and Prof. Bernd Gärtner

// Programm: max2unix-iterator.C // Konvertiert MAC textfiles in UNIX textfiles #include #include void mac_to_unix(std::string::iterator b, std::string::iterator e) // POST: Im range [b,e) wurde jedes Auftreten von // linefeed (LF) durch carriage-return (CR) ersetzt. { for (; b != e; ++b) if (*b == '\r') *b = '\n'; } int main() { std::string f; // Lies eine ganze Zeile auf einmal ein. std::getline(std::cin, f); mac_to_unix(f.begin(), f.end()); std::cout << f; return 0; }