Advertisement
STANAANDREY

divide nr mari

Mar 6th, 2020
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1.    
  2. void divide(int a[], int x)
  3. {
  4.     int cobor = 0, q = 0;
  5.     for (int i = a[0]; i; i--)
  6.     {
  7.         cobor = cobor * 10 + a[i];
  8.         q = cobor / x;
  9.         a[i] = q;
  10.         cobor -= q * x;
  11.     }
  12.  
  13.     while (!a[a[0]])
  14.     {
  15.         a[0]--;
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement