Doar subpunctele 1,2

Doar Subpunctele 12 class=

Răspuns :

1. 897793

2. 2789

int ex(int n){

   int x = 0, p = 1;

   do{

       x = x + (9 - n % 10) * p;

       n /= 10;

       p *= 10;

   } while(n != 0);

   return x;

}