留言

主題:

關於比賽時流程控制問題

留言人:

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)之類的其他方式?
目前回應文章
回覆人 主題 回覆日期
skipperRe::2010/11/20 上午 09:44:14
Penut花生Re::2010/11/20 下午 09:22:07
Ming TsayRe:關於比賽時流程控制問題:2010/11/21 下午 02:36:51
下一頁 最後一頁 頁次:1/1
我要回覆
您所選擇的文章內容

主題:

暱稱:

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----
回到首頁 聯絡我們 留言版 常見詢答 最新消息 我們的服務