請寫一個程式,讀入兩個數字,並求出它們的和。
輸入說明 :
每一組輸入有兩個整數(int)
輸出說明 :
輸出該兩整數的和(int)
範例輸入 :
5
10
1
2
範例輸出 :
15
3
程式碼:
#include<stdio.h>
int main()
{
    int a,b;
    
    while(scanf(" %d %d",&a,&b)==2)
        printf("%d\n",a+b);
    return 0;
}
http://zerojudge.tw/ShowProblem?problemid=a002
 
沒有留言:
張貼留言