fork download
  1. #include <stdio.h>
  2.  
  3. const int MAX=200000000;
  4.  
  5. int float_for_problem()
  6. {
  7. int i;float j;
  8. for (i=1,j=1.0f;i<=MAX;i++,j++)
  9. {
  10. if (j!=i) return i; //problem found
  11. }
  12. return 0; //no problem found
  13. }
  14.  
  15. int double_for_problem()
  16. {
  17. int i;double j;
  18. for (i=1,j=1.0;i<=MAX;i++,j++)
  19. {
  20. if (j!=i) return i; //problem found
  21. }
  22. return 0; //no problem found
  23. }
  24.  
  25. int main(void) {
  26. // double for problem
  27. printf ("float for problem number (0 means no problem found)= %d\n",
  28. float_for_problem());
  29. printf ("double for problem number (0 means no problem found)= %d\n",
  30. double_for_problem());
  31. return 0;
  32. }
  33.  
Success #stdin #stdout 1.43s 2292KB
stdin
Standard input is empty
stdout
float  for problem number (0 means no problem found)= 0
double for problem number (0 means no problem found)= 0