留言
|
主題: |
Sample C++ |
留言人: |
skipper |
留言日期: | 2010/11/20 上午 11:28:32 |
留言IP: | 140.112.24.183 |
留言內容: |
#include <iostream> //注意 < 會被留言版改成全形的<, 請自己改回來 using namespace std; int main() { int a,b; while(cin>>a>>b){ cout << a+b << "\n"; } return 0; } |
目前回應文章
|
回覆人 | 主題 | 回覆日期 |
Ming Tsay | Sample C: | 2010/11/21 下午 02:34:30 |
主題: | |
暱稱: | Ming Tsay |
留言日期: | 2010/11/21 下午 02:34:30 |
留言IP: | 125.228.250.*** |
內容: | //Sample C //注意 < 會被留言版改成全形的<, 請自己改回來 //還有為了排版採用的全形( )空格 #include <stdio.h> int main () { int a, b, i; for (i = 0; i < 3; ++i) { scanf ("%d %d", &a, &b); printf ("%d\n", a + b); } return 0; } skipper said---- >#include <iostream> >//注意 < 會被留言版改成全形的<, 請自己改回來 >using namespace std; >int main() >{ >int a,b; >while(cin>>a>>b){ >cout << a+b << "\n"; >} >return 0; >} > end of skipper said---- |