当前位置: 首页 > news >正文

【HDU】1089 A+B for Input-Output Practice (I)

1089 A+B for Input-Output Practice (I):以EOF结尾的输入

Problem Description
Your task is to Calculate a + b.
Too easy?! Of course! I specially designed the problem for acm beginners.
You must have found that some problems have the same titles with this one, yes, all these problems were designed for the same aim.Input
The input will consist of a series of pairs of integers a and b, separated by a space, one pair of integers per line.Output
For each pair of input integers a and b you should output the sum of a and b in one line, and with one line of output for each line in input.Sample Input
1 5
10 20Sample Output
6
30
#include<cstdio>
int main(){int a,b;while(scanf("%d %d",&a,&b)!=EOF ){printf("%d\n",a+b);}return 0;
}
//cpp
#include<iostream>
using namespace std;
int main(){int a,b;while(cin >> a >> b ){cout << a+b << endl;}return 0;
}
http://www.lryc.cn/news/515835.html

相关文章:

  • lua库介绍:数据处理与操作工具库 - leo
  • 逆向入门(1)C篇-正儿巴经的第1个实验
  • vue数据请求通用方案:axios的options都有哪些值
  • 使用R语言绘制标准的中国地图和世界地图
  • 【PyTorch】迁移学习、数据增强
  • Lucas-Kanade光流法详解
  • python多张图片生成/合成gif
  • iptable限制多个端口出站
  • springmvc--请求参数的绑定
  • Redis查询缓存
  • 双馈风电DFIG并网系统次转子侧变流器RSC抑制策略研究基于LADRC和重复控制的方法
  • 国产编辑器EverEdit - 使用技巧:变量重命名的一种简单替代方法
  • 使用SSH建立内网穿透,能够访问内网的web服务器
  • JWT认证实战
  • 计算机网络 (23)IP层转发分组的过程
  • 权限管理的方法
  • 【郑大主办、ACM出版、EI稳定检索】第四届密码学、网络安全与通信技术国际会议 (CNSCT 2025)
  • 48小时,搭建一个设备巡检报修系统
  • 基于Redisson实现重入锁
  • Java文件操作的简单示例
  • 删除与增加特定行
  • 动态规划六——两个数组的dp问题
  • 项目优化之策略模式
  • [读书日志]从零开始学习Chisel 第四篇:Scala面向对象编程——操作符即方法(敏捷硬件开发语言Chisel与数字系统设计)
  • 三子棋游戏
  • MyBatis执行一条sql语句的流程(源码解析)
  • 【电机控制】低通滤波器及系数配置
  • ArcgisServer过了元旦忽然用不了了?许可过期
  • 如何在不丢失数据的情况下从 IOS 14 回滚到 IOS 13
  • 【算法刷题】链表