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