[C++ ] 字串處理

看板NTUBIME103HW作者 (steve)時間15年前 (2010/12/11 23:11), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
這提其實很簡單 問題應該都是ctrl+Z吧 我的方法是這樣 while(cin) 當你輸入ctrl+z 在壓enter他就會跳出了 寫法如下(記得include string) void main() { string str1; while(cin) { getlin(cin,str1); for(int i=str1.length()-1;i>-1;i--) cout<<str1.at(i); cout<<endl; } return 0; } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.34.202.142
文章代碼(AID): #1D0vIfeb (NTUBIME103HW)