Advertisement
JakubJaneczek

Zadanie 8

Mar 24th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4. int a,b;
  5.  
  6. void podzielnosc(int a, int b)
  7. {
  8.     int c=pow(10,a-1);
  9.     int d=pow(10,a);
  10.  
  11.  
  12.     while(c<d)
  13.     {
  14.         if(c%b==0)
  15.         {
  16.             cout << c << endl;
  17.         }
  18.         c++;
  19.     }
  20. }
  21.  
  22. int main()
  23. {
  24.     cout << "ilo-cyfrowe" << endl;
  25.     cin >> a;
  26.     cout << "dzielnik" << endl;
  27.     cin >> b;
  28.     cout << endl;
  29.     podzielnosc(a,b);
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement