作者jasonfghx (工人)
看板NTUBIME102HW
標題[C++ ] 上機3
時間Tue Dec 1 17:55:39 2009
#include<iostream>//header file
#include<iomanip>
#include<cmath>
using namespace std;
using std::setw;
using std::fixed;
using std::setprecision;
#include<string>
using std::string;
using std::getline;
int main()
{
string set;
int a;
char c;
cout<<"enter ^z to exit"<<endl;
while((c=cin.get())!=EOF)
{
getline(cin,set);
a=set.size();
for(int i=a-1;i>=0;i--)
{
cout<<set[i];
}
cout << c;
cout<<endl;
}
system("pause");
return 0;
}
考古題答案跑不出
給各位參考
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.7.59