Commit 866f4217 authored by Michael's avatar Michael

michael.davityan:exercise_07_36v3

parent 367a2a68
......@@ -9,8 +9,6 @@ stringReverse(std::string& string, const size_t firstIdx = 0)
if ('\0' != string[firstIdx]) {
std::cout << string[(sizeOfString - 1) - firstIdx];
return stringReverse(string, firstIdx + 1);
} else {
std::cout << std::endl;
}
}
......@@ -19,13 +17,14 @@ main()
{
if (::isatty(STDIN_FILENO)) {
std::cout << "This program takes string from user\n"
<< "and print it reversed.\n"
<< "and prints it reversed.\n"
<< "insert string: ";
}
std::string string;
std::getline(std::cin, string);
std::cout << "reversed: ";
stringReverse(string);
std::cout << std::endl;
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment