#include <iostream>
using std::cout, std::cin, std::endl;
int main()
{
unsigned int maxim{100}; // задаем максимальную длину строки
char string[maxim];
cout << "please, enter the text: ";
cin.getline(string, maxim);
unsigned int counter{};
for (; counter < maxim && string[counter] != '\0'; counter++) {}
cout << "Length of your string equal: " << counter << endl;
for (int i{}; i <= counter; i++)
{
cout << string[counter - i];
}
cout << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBzdGQ6OmNvdXQsIHN0ZDo6Y2luLCBzdGQ6OmVuZGw7CgppbnQgbWFpbigpCnsKICAgIHVuc2lnbmVkIGludCBtYXhpbXsxMDB9OyAvLyDQt9Cw0LTQsNC10Lwg0LzQsNC60YHQuNC80LDQu9GM0L3Rg9GOINC00LvQuNC90YMg0YHRgtGA0L7QutC4CiAgICBjaGFyIHN0cmluZ1ttYXhpbV07CiAgICBjb3V0IDw8ICJwbGVhc2UsIGVudGVyIHRoZSB0ZXh0OiAiOwogICAgY2luLmdldGxpbmUoc3RyaW5nLCBtYXhpbSk7CiAgICB1bnNpZ25lZCBpbnQgY291bnRlcnt9OwogICAgZm9yICg7IGNvdW50ZXIgPCBtYXhpbSAmJiBzdHJpbmdbY291bnRlcl0gIT0gJ1wwJzsgY291bnRlcisrKSB7fQogICAgY291dCA8PCAiTGVuZ3RoIG9mIHlvdXIgc3RyaW5nIGVxdWFsOiAiIDw8IGNvdW50ZXIgPDwgZW5kbDsKICAgIGZvciAoaW50IGl7fTsgaSA8PSBjb3VudGVyOyBpKyspCiAgICB7CiAgICAgICAgY291dCA8PCBzdHJpbmdbY291bnRlciAtIGldOwogICAgfQogICAgY291dCA8PCBlbmRsOwogICAgcmV0dXJuIDA7Cn0K