CF898A Rounding

    • 490通过
    • 841提交
  • 题目来源 CodeForces 898A
  • 评测方式 RemoteJudge
  • 标签 字符串 枚举,暴力 概率论,统计 模拟
  • 难度 入门难度
  • 时空限制 1000ms / 256MB

题解

  • 提示:收藏到任务计划后,可在首页查看。
  • 最新讨论 显示

    推荐的相关题目 显示

    题意翻译

    给你一个数字,将其“四舍六入”,末尾为5舍去或进位都可,求最终的数字。

    题目描述

    Vasya has a non-negative integer $ n $ . He wants to round it to nearest integer, which ends up with $ 0 $ . If $ n $ already ends up with $ 0 $ , Vasya considers it already rounded.

    For example, if $ n=4722 $ answer is $ 4720 $ . If $ n=5 $ Vasya can round it to $ 0 $ or to $ 10 $ . Both ways are correct.

    For given $ n $ find out to which integer will Vasya round it.

    输入输出格式

    输入格式:

    The first line contains single integer $ n $ ( $ 0<=n<=10^{9} $ ) — number that Vasya has.

    输出格式:

    Print result of rounding $ n $ . Pay attention that in some cases answer isn't unique. In that case print any correct answer.

    输入输出样例

    输入样例#1: 复制
    5
    
    输出样例#1: 复制
    0
    
    输入样例#2: 复制
    113
    
    输出样例#2: 复制
    110
    
    输入样例#3: 复制
    1000000000
    
    输出样例#3: 复制
    1000000000
    
    输入样例#4: 复制
    5432359
    
    输出样例#4: 复制
    5432360
    

    说明

    In the first example $ n=5 $ . Nearest integers, that ends up with zero are $ 0 $ and $ 10 $ . Any of these answers is correct, so you can print $ 0 $ or $ 10 $ .

    提示
    标程仅供做题后或实在无思路时参考。
    请自觉、自律地使用该功能并请对自己的学习负责。
    如果发现恶意抄袭标程,将按照I类违反进行处理。