Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
736 B
2
Indexable
Never
#include<iostream>
#include<cstring>
#include<cmath>
#include<map>
#include<vector>
#include<set>
#include<stack>
#include<queue>
#include <iterator>
#include <algorithm>
#include<sstream>
#define ll long long
#define N 20001
#define yes puts("YES");
#define no puts("NO");
using namespace std;
string lamtron(string num)
{
int up=0,down=0;
string s=num,str="";
int n=s.size();
if(n<2) return s;
for(int i=1;i<n;i++){
if(s[i]>='5') { up=1; break;}
else {down=1; break; }
}
int so=s[0]-'0';
if(up){
str+=to_string(so+1);
for(int i=1;i<n;i++) str+="0";
}
else
{
str+=to_string(so);
for(int i=1;i<n;i++) str+="0";
}
return str;
}
main()
{
int t;
string num;
cin>>num;
cout<<lamtron(num)<<endl;
}