https://www.acmicpc.net/problem/2033
#include<stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
int n;
scanf("%d",&n);
int t=1;
int num=n;
while(n>9){
int a=n%10;
if(a>=5){
num+=(10-a)*t;
n+=10;
}
else num-=a*t;
t*=10;
n/=10;
}
printf("%d",num);
}