Advertisement
Michal_Pilarski

zad8

Mar 19th, 2020
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int a=1,b=1,c,e;
  5. void podzielnosc(int a, int e)
  6. {
  7.     for(int i=1; i<=a; i++)
  8.     {
  9.         b = b*10;
  10.     }
  11.     c = b/10;
  12.  
  13.     for(int j=c; j<b; j++)
  14.     {
  15.         if(j%e==0)
  16.         {
  17.             cout<<j<<endl;
  18.         }
  19.     }
  20. }
  21.  
  22. int main()
  23. {
  24.  
  25.     cout<<"Podaj ilocyfrowe maja byc liczby"<<endl;
  26.     cin >> a;
  27.     cout<<"Podaj przez jaka liczbe maja byc podzielne"<<endl;
  28.     cin >> e; //dzielnik
  29.     podzielnosc(a,e);
  30.  
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement