Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- // Karol Woźniak 18.03.2020r
- using namespace std;
- int liczba1, liczba2;
- int PODZIELNOSC(int a, int b)
- {
- int i,j;
- if(a==1)
- {
- for(i=1; i<=9; i++)
- {
- if(i%b==0)
- {
- cout << i << " ";
- }
- }
- }
- else
- {
- j=pow(10,a);
- j=j-1;
- a=a-1;
- i=pow(10,a);
- for(i;i<=j;i++)
- {
- if(i%b==0)
- {
- cout << i << " ";
- }
- }
- }
- }
- int main()
- {
- cout << "Podaj ilocyfrowe liczby cie interesuja: ";
- cin >> liczba1;
- cout << "Podaj, przez co maja byc podzielone: ";
- cin >> liczba2;
- PODZIELNOSC(liczba1, liczba2);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment