Advertisement
nicuvlad76

Untitled

Nov 5th, 2022
731
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. /**
  4.  baze de numeratie
  5.   1. transformare din b10 in bq (2<=q<=9)
  6.   2. transformre din bq in b10
  7.      a. numarul se cisteste intreg
  8.      b. cifra cu cifra  = 428
  9.  */
  10.  
  11. long long  n, q, n10, c, i;
  12.  
  13. int main()
  14. {
  15.     ///2b.
  16.   cin>>q>>n;///n numarul de cifre
  17.   n10=0;
  18.   for(i=1;i<=n;i++)
  19.   {
  20.       cin>>c;
  21.       n10=n10*q+c;
  22.   }
  23.   cout<<n10;
  24.   return 0;
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement