首页 > 学院 > 开发设计 > 正文

A+B Problem

2019-11-08 02:32:24
字体:
来源:转载
供稿:网友

描述

输入两个自然数,输出他们的和

格式

输入格式

两个自然数x和y 0 <= x, y <= 327670<=x,y<=32767

输出格式

一个数,即x和y的和

样例

样例输入

123 500

样例输出

623

答案:

C++ Code

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

C Code

#include <stdio.h>int main(){ int a, b; scanf("%d%d", &a, &b); PRintf("%d/n", a + b); return 0;}

Free Pascal Code

var a,b:longint;beginreadln(a,b);writeln(a+b);end.

java Code

import java.io.*;import java.util.Scanner;public class Main { /** * @param args * @throws IOException */ public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); System.out.println(a + b); }}
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表