fork(1) download
  1. #include <stdio.h>
  2. #include <time.h>
  3. #include <math.h>
  4.  
  5. double produceOne()
  6. {
  7. double result = 0;
  8. for (int i = 1; i <= 10; ++i)
  9. {
  10. result += 1 / (i * (i + 1));
  11. printf("%d %d\n", result, 1 / (i * (i + 1)));
  12. }
  13. return result;
  14. }
  15.  
  16. int main(void)
  17. {
  18. int a[10000];
  19. int commonCondition = 1;
  20.  
  21. clock_t tStart = clock();
  22.  
  23. for (int i = 0; i < 10000; ++i)
  24. {
  25. if (sin(.78)*sin(.78) + cos(.78)*cos(.78))
  26. {
  27. if (!(i % 2))
  28. {
  29. a[i] = i;
  30. }
  31. else
  32. if (!(i % 3))
  33. {
  34. a[i] = -1;
  35. }
  36. }
  37. }
  38.  
  39. printf("%d\n", produceOne());
  40. printf("Time taken: %fs\n", (double)(clock() - tStart)/CLOCKS_PER_SEC);
  41.  
  42. return 0;
  43. }
  44.  
Success #stdin #stdout 0s 9432KB
stdin
Standard input is empty
stdout
0 3283
0 625248096
0 625248096
0 625248096
0 625248096
0 625248096
0 625248096
0 625248096
0 625248096
0 625248096
0
Time taken: 0.000063s