fork(3) download
  1. /*
  2.  * https://p...content-available-to-author-only...r.net/problem=1
  3.  */
  4. #include <stdio.h>
  5. #define SIZE (1000)
  6. int main(void) {
  7. int list[SIZE] = { 0 };
  8. int sum = 0;
  9. int i;
  10.  
  11. for (i = 3; i < SIZE; i += 3) ++list[i];
  12. for (i = 5; i < SIZE; i += 5) ++list[i];
  13. for (i = 3; i < SIZE; i += 2) if (list[i]) sum += i;
  14. printf("%d\n", sum);
  15.  
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 2248KB
stdin
Standard input is empty
stdout
117332