#include<stdio.h>
#include<math.h>
int main()
{
int m = 0;
int d = 0;
printf("Enter a number:");
scanf("%d", &m);
int num = 0;
int i = 0;
while (m)
{
d += ((m % 10 + 9) % 10)*pow(10,i);
m /= 10;
i++;
}
while (i)
{
if(i==4)//个位
num += (d % 10) * 100;
if (i == 3)//十位
num += (d % 10) * 1000;
if(i==2)//百位
num += (d % 10) ;
if (i == 1)//千位
num += (d % 10) * 10;
d /= 10;
i--;
}
printf("The encrypted number is %d", num);
return 0;
}