![]() |
#2
lsrwan2010-05-13 22:52
|
#include <iostream>
#include <string>
int main()
{
using namespace std;
cout << "Enter a word: ";
string word;
cin >> word;
// display letters in reverse order
for (int i = word.size() - 1; i >= 0; i--)
cout << word[i];
cout << "\nBye.\n";
return 0;
}
不知道这个字符串的用法 word.size() 希望大家帮忙下