Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void aduna(int a[], int b[], int rezultat[])
- {
- int tran = 0, maxi, c, i;
- if (a[0] < b[0])
- {
- maxi = b[0];
- for (i = a[0] + 1; i <= b[0]; i++)
- a[i] = 0;
- }
- else
- {
- maxi = a[0];
- for ( i = b[0] + 1; i <= a[0]; i++)
- b[i] = 0;
- }
- for (i = 1; i <= maxi; i++)
- {
- c = a[i] + b[i] + tran;
- rezultat[i] = c % 10;
- tran = c / 10;
- }
- if (tran)
- rezultat[i] = tran;
- else
- i--;
- rezultat[0] = i;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement