Guest User

Untitled

a guest
Jul 23rd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1. while (!fin1.eof()){
  2.         store = 0;
  3.         for (int j = 0; j < N; j++){
  4.             if (!fin1.eof()){
  5.                 fin1 >> a[j];
  6.                 cout <<"a: " << a[j] << " ";
  7.                 n1++;
  8.                 cout << "n1:"<< n1 << " ";
  9.             }
  10.             else {
  11.                     a[j] = 0;
  12.             }
  13.         }
  14.         for (int j = 0; j < N; j++) {
  15.             highBit = a[j] & 128;
  16.             //cout << "highBit: " << highBit << " ";
  17.             a[j] = a[j] & 127;
  18.             //cout << "a: " << a[j] << " ";
  19.             highBit = highBit >> 7;
  20.             //cout << "highBit: " << highBit << " ";
  21.             store = store << 1;
  22.             //cout << "store: " << store << " ";
  23.             store = store | highBit;
  24.             //cout << "store: " << store << " ";
  25.             fout1 << a[j];
  26.             //cout << "a[j]: "<< a[j] << endl;
  27.         }
  28.         fout1 << store;
  29.     }
Add Comment
Please, Sign In to add comment