hiho第一周A+B各种语言版本(内容来自hiho)
来源:互联网 发布:阿里云网站上线 编辑:程序博客网 时间:2024/06/16 17:21
时间限制:1000ms
单点时限:1000ms
内存限制:256MB
- 样例输入
1 23 4
- 样例输出
3
7
C语言 样例程序 #include <stdio.h>int main(void) { int a, b; while(scanf("%d%d", &a, &b) != EOF) { printf("%d\n", a + b); } return 0;}
C++#include <iostream>using namespace std;int main(void) { int a, b; while(cin >> a >> b) { cout << a + b << endl; } return 0;}
Javaimport java.util.Scanner;public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); while(in.hasNext()) { int a = in.nextInt(); int b = in.nextInt(); System.out.println(a + b); } }}
C#using System;public class AplusB{ private static void Main() { string line; while((line = Console.ReadLine()) != null) { string[] tokens = line.Split(' '); Console.WriteLine(int.Parse(tokens[0]) + int.Parse(tokens[1])); } }}
Python2while True: try: (x, y) = (int(x) for x in raw_input().split()) print x + y except EOFError: break
描述
求两个整数A+B的和
输入
输入包含多组数据。
每组数据包含两个整数A(1 ≤ A ≤ 100)和B(1 ≤ B ≤ 100)。
输出
对于每组数据输出A+B的和。
0 0
- hiho第一周A+B各种语言版本(内容来自hiho)
- hiho一下 第一周
- hiho一下第一周
- hiho第一周
- HiHo 1000 A+B
- hiho 1000: A+B
- hiho 1000 : A + B (数学)
- hiho刷题日记——第一天 A+B
- (hiho一下第一周)#1032 最长回文子串
- hiho 第一周 最长回文子串
- 【hihoCoder】【1032】hiho一下第一周/A:最长回文子串
- hiho第173周 A Game (区间DP)
- hiho~
- hiho一下 第五十一周
- hiho一下 第六十一周
- hiho第七十一周 Constellations
- A Game hiho一下第173周
- 【hiho一下】第一周 最长回文子串
- Linux服务器时间同步
- 一起学Netty(六)之 TCP粘包拆包场景
- JBPM4.4业务流程管理框架详细解读
- Android Studio 常用快捷键
- Linux驱动开发(二)—DMA的使用(一)
- hiho第一周A+B各种语言版本(内容来自hiho)
- tabhost相关报错
- 向良好进军!
- plugin & hook
- find命令
- 对JPA实体关系管理双向关联的一些思考
- Android 开发者的 RxJava 详解 - 作者:扔物线
- 欢迎使用CSDN-markdown编辑器
- hrbustOJ 1787 New Fibonacci Number (矩阵快速幂+欧拉公式降幂)