fork download
  1. #include <stdio.h>
  2. main() {
  3. int s, el = 0;
  4. for (int i = 6; i <= 30; i++) {
  5. s=0;
  6. for (int j = 1; j <= i / 2; j++)
  7. if (i % j == 0)
  8. s = s + j;
  9. if (s == i)
  10. el++;
  11. }
  12. printf("%d", el);
  13. }
  14.  
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
2