0
How to reverse alphabets in C++
Actually i want to write code which reverse every alphabets like Everyone to enoyrevE
3 ответов
+ 2
Post your attempt...
Just using a loop will do that work..
+ 2
#include <string>
int main()
{
std::string word = "Everyone";
std::string reversedWord = "";
for(int i = word.length() - 1; i > 0; i--)
{
reversedWord.at(i - (word.length() - 1)) = word.at(i);
}
return 0;
}
+ 1
Thanks #donato