Advertisement
Carbastan

p10_p10

Dec 1st, 2022
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n, k, cifre = 1;
  8.  
  9.     cin >> n >> k;
  10.  
  11.     if(k == 0)
  12.     {
  13.         cout << 1;
  14.         return 0;
  15.     }
  16.  
  17.     cout << 1;
  18.  
  19.     while(n > 9)
  20.     {
  21.         cifre++;
  22.         n /= 10;
  23.     }
  24.  
  25.     --cifre;
  26.  
  27.     for(int i = 1; i <= cifre * k; i++)
  28.     {
  29.         cout << 0;
  30.     }
  31.  
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement