You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
340 B
19 lines
340 B
#include <iostream>
|
|
int main()
|
|
{
|
|
using namespace std;
|
|
cout << "Enter a word: ";
|
|
string word;
|
|
cin >> word;
|
|
|
|
char temp;
|
|
int i, j;
|
|
for (j = 0, i = word.size() - 1; j < i; --i, ++j)
|
|
{
|
|
temp = word[i];
|
|
word[i] = word[j];
|
|
word[j] = temp;
|
|
}
|
|
cout << word << "\nDone\n";
|
|
return 0;
|
|
}
|