fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a = 1;
  5. int b = 1;
  6.  
  7. while (1)
  8. {
  9. int c = (int)((double)a / b * 1000 + 0.5);
  10. if (c < 334)
  11. a++;
  12. else if (c > 334)
  13. b++;
  14. else
  15. break;
  16. }
  17.  
  18. printf("%d/%d", a, b);
  19.  
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 2008KB
stdin
Standard input is empty
stdout
96/287