Skip to content

11000: 【原1000】A+B Problem

题目

题目描述

author: Online Judge 原OJ链接:https://acm.sjtu.edu.cn/OnlineJudge-old/problem/1000

Description

作为所有 Online Judge 的传统题目,你只需读两个整数,输出即可,保证输入的数绝对值不超过1000。

Input Format

一行,两个空格隔开的整数A,B。

Output Format

一个数A+B。

Sample Input

3 2

Sample Output

5

FineArtz's solution

/* A+B Problem */
#include <iostream>

int main(){
   int a, b;
   std::cin >> a >> b;
   std::cout << a + b << std::endl;
   return 0;
}

ligongzzz's solution

#include <iostream>
using namespace std;

int main(){
    int a, b;
    cin >> a >> b;
    cout << a + b;

    return 0;
}

satgo1546's solution

import java.io.BufferedInputStream;
import java.util.Scanner;

// The class must be named Main.
// Non-ASCII characters are not allowed, not even in comments.
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(new BufferedInputStream(System.in));
        int a = in.nextInt();
        int b = in.nextInt();
        System.out.println(a + b);
    }
}

yyong119's solution

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