题目链接:https://abc082.contest.atcoder.jp/tasks/abc082_a

Time limit : 2sec / Memory limit : 256MB

Score : 100 points

Problem Statement

You are given two positive integers a and b. Let x be the average of a and b. Print x rounded up to the nearest integer.

Constraints

  • a and b are integers.
  • 1≤a,b≤100

Input

Input is given from Standard Input in the following format:

a b

Output

Print x rounded up to the nearest integer.


Sample Input 1

Copy
1 3

Sample Output 1

Copy
2

The average of 1 and 3 is 2.0, and it will be rounded up to the nearest integer, 2.


Sample Input 2

Copy
7 4

Sample Output 2

Copy
6

The average of 7 and 4 is 5.5, and it will be rounded up to the nearest integer, 6.


Sample Input 3

Copy
5 5

Sample Output 3

Copy
5

 #include <iostream>
#include <cstdio>
#include <algorithm>
#include <stack>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdio>
using namespace std;
int main()
{
int a,b;
while(cin>>a>>b){
if((a+b)%==) cout<<(a+b)/<<endl;
else{
int c=(a+b)/;
if(a+b-*c<=) cout<<c+<<endl;
else cout<<c<<endl;
}
}
return ;
}

最新文章

  1. 常用Jquery插件整理
  2. ArrayList转成HashMap再转成LinkedHashMap 自己的解决方案
  3. 嵌入式linux驱动开发之给linux系统添加温度传感器模块
  4. json格式转换成Map的应用
  5. (转)Eclipse “cannot be resolved to a type” error
  6. js设置与获取Cookie
  7. VS2015创建的C++程序在Debug模式下不能调试
  8. jmeter、java自动化学习地址
  9. 使用Travis CI自动部署Hexo博客
  10. 山西某公司NetApp存储不小心删除文件数据恢复成功案例
  11. Business Intelligence Tools We Recommend 1/4 – Metabase
  12. Debian系统 + XFCE桌面初识,基础环境搭建
  13. java引用类型简述
  14. best performance / best appearance
  15. 3-51单片机ESP8266学习-AT指令(学会刷固件)
  16. 清除数据库表、外键、存储过程SQL
  17. linux中合并多个文件内容到一个文件的例子
  18. 微信小程序如何获取屏幕宽度
  19. js-jquery-SweetAlert【二】配置方法
  20. linux 下vim文件乱码 cat文件正常处理方法

热门文章

  1. vs2015智能提示英文改为中文
  2. 002-pro ant design 表单基本使用、state赋值数据父子传输
  3. bootbox.js官方文档中文版
  4. HyperlinkedIdentityField
  5. matplot绘图
  6. 阿里云香港主机自动换IP
  7. js贪心算法---背包问题
  8. iOS UI基础-12.0 Storyboard
  9. RNN的深入理解
  10. (2)Python3笔记 数据类型之&quot;组&quot;(序列) 与 集合