HOJ 1002 A+B+C

Time limit : 3 sec   Memory limit : 32 M


For each pair of integers A B and C ( -2^31 <= A, B, C<= 2^31-1 ), Output the result of A+B+C on a single line.

Sample Input
1 2 3
3 4 3
Sample Output
6
10
提示 請注意32位機上int的表示範圍。

Solution:
#include <stdio.h>

int main()
{
    long long int a,b,c;
    while(scanf("%lld %lld %lld",&a,&b,&c) == 3)
    {
        printf("%lld\n", a+b+c);
    }
    return 0;
}


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章