Advertisement
STANAANDREY

imp nr mari

Aug 12th, 2019
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. int imparte(int a[], int x, int rezultat[])
  2. {
  3.     int i, r = 0;
  4.     for (i = a[0]; i; i--)
  5.     {
  6.         r = 10 * r + a[i];
  7.         rezultat[i] = r / x;
  8.         r %= x;
  9.     }
  10.     rezultat[0] = a[0];
  11.     while (!rezultat[rezultat[0]] && rezultat[0] > 1)
  12.         rezultat[0]--;
  13.     return r;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement