fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.  
  5. int total_time = 12 * 60 * 60 * 1000;
  6.  
  7. int tanshin_speed = 1;
  8. int choshin_speed = tanshin_speed * 12;
  9. int byoshin_speed = choshin_speed * 60;
  10.  
  11. int tanshin_position = 0;
  12. int choshin_position = 0;
  13. int byoshin_position = 0;
  14.  
  15. while (tanshin_position < total_time) {
  16.  
  17. if (tanshin_position == choshin_position && tanshin_position == byoshin_position) {
  18. printf("%02d:", tanshin_position / (60 * 60 * 1000));
  19. printf("%02d:", choshin_position / (60 * 60 * 1000));
  20. printf("%02d\n", byoshin_position / (60 * 60 * 1000));
  21. }
  22.  
  23. tanshin_position += tanshin_speed;
  24. choshin_position += choshin_speed;
  25. choshin_position %= total_time;
  26. byoshin_position += byoshin_speed;
  27. byoshin_position %= total_time;
  28.  
  29. }
  30.  
  31. return 0;
  32. }
  33.  
Success #stdin #stdout 0.32s 2052KB
stdin
Standard input is empty
stdout
00:00:00