Codeforces Round #451 (Div. 2) A. Rounding

来源:互联网 发布:手机淘宝6.10.3 编辑:程序博客网 时间:2024/05/22 11:25

题目大意

将数四舍五入…

题解

逗比题…

#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;int read(){    char ch=getchar();int f=0;    while(ch<'0'||ch>'9') ch=getchar();    while(ch>='0'&&ch<='9') {f=f*10+(ch^48);ch=getchar();}    return f;}int main(){    int x=read();    if(x%10>=5)    {        printf("%d",x/10*10+10);    }    else printf("%d",x/10*10);}
原创粉丝点击