留言
|
主題: |
關於比賽時流程控制問題 |
留言人: |
Penut花生 |
留言日期: | 2010/11/20 上午 02:08:09 |
留言IP: | 123.204.108.156 |
留言內容: |
如果以去年的一定中樂透來講: /***/ #include <iostream> #include <fstream> using namespace std; int main() { int a,b; ifstream fin("pc.in"); ofstream fout("pc.out"); fin >> a >> b; while(a!=0 && b!=0) { if(a%2==b%2) cout << "Win" << endl; else cout << "Loss" << endl; fin >> a >> b; } } /***/ 我的重點是 開關檔方式一樣如上嗎? 還是用while(cin >> a >> b)之類的其他方式? |
目前回應文章
|
回覆人 | 主題 | 回覆日期 |
skipper | Re:: | 2010/11/20 上午 09:44:14 |
Penut花生 | Re:: | 2010/11/20 下午 09:22:07 |
Ming Tsay | Re:關於比賽時流程控制問題: | 2010/11/21 下午 02:36:51 |
主題: | |
暱稱: | Ming Tsay |
留言日期: | 2010/11/21 下午 02:36:51 |
留言IP: | 125.228.250.*** |
內容: | 對對對就是那樣!!! Penut花生 said---- >如果以去年的一定中樂透來講: > >/***/ >#include <iostream> >#include <fstream> >using namespace std; >int main() >{ > int a,b; > ifstream fin("pc.in"); > ofstream fout("pc.out"); > fin >> a >> b; > while(a!=0 && b!=0) > { > if(a%2==b%2) cout << "Win" << endl; > else cout << "Loss" << endl; > fin >> a >> b; > } >} >/***/ > >我的重點是 開關檔方式一樣如上嗎? >還是用while(cin >> a >> b)之類的其他方式? end of Penut花生 said---- |