fork download
  1. //Divisor Summation PD13
  2.  
  3. #include <stdio.h>
  4. int main (void)
  5. {
  6. int x, y, z, a;
  7. scanf ("%d", &x);
  8. for (x; x > 0; --x)
  9. {
  10. scanf ("%d", &y);
  11. z = y;
  12. a = 0;
  13. for (z - 1; z > 0; --z)
  14. {
  15. if (y % z == 0)
  16. a = a + z;
  17. }
  18. printf ("%d\n", a);
  19. }
  20. return 0;
  21. }
Success #stdin #stdout 0s 2296KB
stdin
3
2
10
20
stdout
3
18
42