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

Theory of Combinatorial Algorithms

Prof. Emo Welzl and Prof. Bernd Gärtner

// Programm: max2unix-index.C // Konvertiert MAC textfiles in UNIX textfiles #include #include void mac_to_unix(std::string& s) // POST: In s wurde jedes Auftreten von linefeed (LF) // durch carriage-return (CR) ersetzt. { for (unsigned int i = 0; i < s.length(); ++i) if (s[i] == '\r') s[i] = '\n'; } int main() { std::string f; // Lies eine ganze Zeile auf einmal ein. std::getline(std::cin, f); mac_to_unix(f); std::cout << f; return 0; }