wiktormadera

zad8

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