Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int podzielnosc(int a, int b)
- { int c, d;
- if (a==1)
- {
- for (d=1; d<=9; d++)
- {
- if (d%b==0)
- {
- cout<<d<<" ";
- }
- }
- }
- else {
- c=pow(10,a);
- c=c-1;
- a=a-1;
- d=pow(10,a);
- for (d; d<=c; d++)
- {
- if(d%b==0)
- {
- cout<<d<<" ";
- }
- }
- }
- }
- int main()
- {
- int a,b;
- cout<<"podaj ilo cyfrowe liczby cie interesuja"<<endl;
- cin>>a;
- cout<<"podaj przez co maja sie dzielic"<<endl;
- cin>>b;
- podzielnosc(a,b);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement