SHARE
TWEET

Untitled

neistadt May 22nd, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void invertLN(LongN * B, int n){
  2.     if(B->sign == 0 || *(B->dig + B->n - 1) == 0){
  3.         return;
  4.     }else{
  5.         char * k;
  6.         B->n = n;
  7.         k = (char *)calloc(B->n, sizeof(char));
  8.         for(int i = 0; i < B->n; i++){
  9.             *(k+i) = *(B->dig+i);
  10.         }
  11.         free(B->dig);
  12.         B->dig = k;
  13.  
  14.         int f = 1;
  15.         for(int i = 0; i < n; i++){
  16.             *(B->dig + i) = 99 + f - *(B->dig + i);
  17.             if(*(B->dig + i) != 100){
  18.                 f = 0;
  19.             }else{
  20.                 *(B->dig + i) = 0;
  21.             }
  22.         }
  23.         return;
  24.     }
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top