fork download
  1. #include <iostream>
  2. using namespace std;
  3. /*
  4. autor: Andrzej Slomka
  5. zadanie 2b
  6. */
  7. int main()
  8. {
  9. int n;
  10. cout << "podaj liczbe:" <<endl;
  11. cin>>n;
  12. int i=1;
  13. while(i<=n)
  14. {
  15. if (n%i==0)
  16. {
  17. cout<<i<<endl;
  18. }
  19. i++;
  20. }
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 4564KB
stdin
10
stdout
podaj liczbe:
1
2
5
10