TopCoder

User's AC Ratio

99.1% (1571/1586)

Submission's AC Ratio

80.9% (1982/2451)

Tags

Description

請計算$a+b$。

Input Format

一行包含兩個正整數$a, b (0\le a, b\le 10)$。

Output Format

輸出一行包含一個數字,代表$a+b$的結果。

Sample Input 1

1 2

Sample Output 1

3

Hints

Q: 要如何輸入、輸出?

A: 你所繳交的程式必須stdin(標準輸入)讀取輸入,並且輸出到stdout(標準輸出)。例如,你可以用C的scanf或C++的cin讀取stdin的輸入,並用C的printf或C++的cout輸出到stdout

請不要輸出任何除了題目要求的答案以外的文字,否則你將會獲得一個WA(Wrong Answer)。

你的程式不能進行讀/寫外部檔案的動作,否則你將會獲得WARE(Runtime Error)。

以下是一個本題的C++/G++範例程式:

#include <iostream>
using namespace std;
int  main()
{
    int a,b;
    cin >> a >> b;
    cout << a+b << endl;
    return 0;
}

請注意,如果使用C++/G++,main()函數的回傳型別必須是int,否則你將會獲得一個CE(Compilation Error)。

以下是一個本題的C/GCC範例程式:

#include <stdio.h>

int main()
{
    int a,b;
    scanf("%d %d",&a, &b);
    printf("%d\n",a+b);
    return 0;
}

Problem Source

原TIOJ 1002

Subtasks

No. Testdata Range Score
1 0 50
2 1 50

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 500 65536 262144 1
1 500 65536 262144 2