fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int SumDel(int a) {
  5. int s = 0;
  6. for (int i = 1; i <= a / 2; i++) {
  7. if (a % i == 0) {
  8. s += i;
  9. }
  10. }
  11. return s;
  12. }
  13.  
  14. int main() {
  15. int s = 0, k = 0, max = 0;
  16. for (int i = 1; i <= 10000; i++) {
  17. if (SumDel(i) >= max) {
  18. max = SumDel(i);
  19. //k = i;
  20. cout << i << " ";
  21. }
  22. }
  23. //cout << k;
  24. return 0;
  25. }
Success #stdin #stdout 0.06s 15240KB
stdin
Standard input is empty
stdout
1 2 3 4 6 8 10 12 18 20 24 30 36 48 60 72 84 90 96 108 120 144 168 180 210 216 240 288 300 336 360 420 480 504 540 600 660 720 840 960 1008 1080 1200 1260 1440 1560 1680 1980 2100 2160 2340 2400 2520 2880 3120 3240 3360 3600 3780 3960 4200 4320 4620 4680 5040 5880 6120 6300 6720 7200 7560 8400 9240