Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int a,b,c;
- void dzielniki(int n)
- {
- int a=1;
- while(a<=n)
- {
- if(n%a==0)
- {
- cout << a << ";";
- }
- a++;
- }
- }
- int main()
- {
- cout << "Dzielniki 5 to" << endl;
- dzielniki(5);
- cout << endl;
- cout << "Dzielniki 6 to" << endl;
- dzielniki(6);
- cout << endl;
- cout << "Dzielniki 7 to" << endl;
- dzielniki(7);
- cout << endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment