看板 NTUBIME102HW 關於我們 聯絡資訊
#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