2013年1月4日 星期五

[ZJ] a002. 簡易加法


內容 :
請寫一個程式,讀入兩個數字,並求出它們的和。
輸入說明 :
每一組輸入有兩個整數(int)
輸出說明 :
輸出該兩整數的和(int)
範例輸入 :
5 101 2
範例輸出 :
153

/**********************************************************************************/
/*  Problem: a002 "簡易加法"                                                  */
/*  Language: C                                                                   */
/*  Result: AC (0ms, 254KB) on ZeroJudge                                          */
/*  Author: restart at 2011-04-04 16:27:43                                        */
/**********************************************************************************/


#include<stdio.h>
main()
{
    int a, b;
    while(scanf("%d %d",&a, &b)==2) 
        printf("%d\n",a+b); 
    return 0;
}

沒有留言:

張貼留言