Advertisement
STANAANDREY

inmultire nr mari

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