NOJ/40/main.c

25 lines
347 B
C
Raw Permalink Normal View History

2020-08-31 16:46:43 +00:00
#include <stdio.h>
int main(void){
int tmp,i,num[4];
scanf("%d",&tmp);
i = 0;
while(tmp > 0){
num[i] = tmp % 10;
tmp /= 10;
i++;
}
tmp = num[3];
num[3] = num[0];
num[0] = tmp;
tmp = num[1];
num[1] = num[2];
num[2] = tmp;
for(i = 3; i >= 0; i--){
num[i] = (num[i] + 5)%10;
printf("%d",num[i]);
}
printf("\n");
return 0;
}