首页 > 试题广场 >

A+B(1)

[编程题]A+B(1)
  • 热度指数:70628 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 256M,其他语言512M
  • 算法知识视频讲解
计算a+b
打开以下链接可以查看正确的代码
https://ac.nowcoder.com/acm/contest/5657#question
数据范围: 数据组数 , 数据大小满足

输入描述:
输入包括两个正整数a,b(1 <= a, b <= 1000),输入数据包括多组。


输出描述:
输出a+b的结果
示例1

输入

1 5
10 20

输出

6
30
头像 Jeff_Lui
发表于 2020-03-13 10:45:04
import java.util.Scanner; /** * 输入包括两个正整数a,b(1 <= a, b <= 10^9),输入数据包括多组 */ public class Main_01 { public static void main(String args[]){ 展开全文
头像 lichen_kk
发表于 2020-04-10 13:53:48
#include<iostream> using namespace std; int main() { int a=0,b=0; while(cin>>a&&cin>>b){ cout<<a+b< 展开全文
头像 死神镰刀
发表于 2022-07-22 19:53:03
既然没有C#版本的,害,我来贡献一下吧。 using System; using System.Linq; public class Program {     public static void& 展开全文
头像 kkk03
发表于 2023-08-06 17:05:21
OJ在线编程常见输入输出练习场OJ在线编程常见输入输出练习场OJ在线编程常见输入输出练习场 A+B(1)A+B(1)A+B(1) 一个while循环搞定一个while循环搞定一个while循环搞定 #include <bits/stdc++.h> using namespace std; 展开全文
头像 XingHe_XingHe
发表于 2021-07-09 16:49:24
链接:https://ac.nowcoder.com/acm/contest/5657/A来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述计算a+b打开以下链接可以查看正确的代码htt 展开全文
头像 牛牛1148号
发表于 2021-09-02 11:22:54
RUST字符串排序 #![allow(dead_code)] use std::io; use std::fmt; #[derive(Debug)] pub struct Inputs { pub v: Vec<String>, } impl Inputs { fn 展开全文
头像 Banner1573
发表于 2021-01-01 09:28:15
include <stdio.h> int main() { int a,b; while(scanf("%d %d",&a, &b) != EOF) {//注意while处理多个case printf("%d\n",a+b); } 展开全文
头像 菜鸡如我
发表于 2021-03-18 22:32:36
博客中(OJ在线编程:C++输入输出控制 ),已整理11种场景的输入处理,参考大佬们造的轮子,封装了C++字符串的分割函数(类似于Java的split方法),欢迎自取。 字符串排序(3)考点:键盘输入多组数据,每组数据个数不定,根据指定字符分割字符串。输入:多个测试用例,每个测试用例一行。每行通过 展开全文
头像 牛客856225070号
发表于 2021-09-05 10:45:23
while True: try: l = list(map(int,input().split())) if l[0] == 0: print(0) else: print(sum(l[0:len(l)]) 展开全文
头像 牛客856225070号
发表于 2021-09-05 10:46:09
while True:     try:                 l = list(map(int,input().split()))       &n 展开全文

热门推荐

通过挑战的用户