Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void PODZIELNOSC(int iloCyfrowe, int przezCoPodzielne)
- {
- if(przezCoPodzielne==0)
- {
- cout << "Nie dziel przez ZERO!" << endl;
- }
- else
- {
- int maks = 1;
- for (int i = 0; i<iloCyfrowe; i++)
- {
- maks*=10;
- }
- int mini = ((maks/10)-1)/przezCoPodzielne;
- mini = (mini+1)*przezCoPodzielne;
- for(int i=mini; i<maks; i=i+przezCoPodzielne)
- {
- cout << i << " ";
- }
- }
- }
- int main()
- {
- int a, b;
- cout << "Ilo cyfrowe liczby:" << endl;
- cin >> a;
- cout << "Przez co maja sie dzielic:" << endl;
- cin >> b;
- PODZIELNOSC(a, b);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement