RafalSobala

zad8

Mar 20th, 2020
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int a,b,mini=1, maks, reszta;
  6.  
  7. void PODZIELNOSC(int a, int b){
  8.  
  9.     for (int z = 1; z<a; z++){
  10.        mini = mini * 10;
  11.     }
  12.  
  13.     maks=(mini*10)-1;
  14.  
  15.  
  16.     for(int i = mini; i < maks; i++){
  17.  
  18.         reszta=i%b;
  19.  
  20.         if(reszta==0){
  21.             cout << i <<", ";
  22.         }
  23.         else{
  24.  
  25.         }
  26.     }
  27.  
  28. }
  29.  
  30. int main()
  31. {
  32.     cout << "Podaj ilu cyfrowe liczby nas interesuja: " << endl;
  33.     cin >> a;
  34.     cout << "Podaj dzielnik: " << endl;
  35.     cin >> b;
  36.  
  37.     PODZIELNOSC(a,b);
  38.  
  39.     return 0;
  40. }
Add Comment
Please, Sign In to add comment