fork download
  1. #include <stdio.h>
  2. #include <stdbool.h>
  3. #include <stdint.h>
  4.  
  5. #define NANOSECONDS_IN_MILLISECOND ((int)1e6)
  6. int main(void) {
  7. // your code goes here
  8. bool splineAckReceived = true;
  9. uint32_t milliseconds_till_empty = 0;
  10. const uint32_t ack_time_dt_ns = 2000000;
  11. const int32_t time_to_go_ms = milliseconds_till_empty - (ack_time_dt_ns / NANOSECONDS_IN_MILLISECOND);
  12. uint32_t scan_router_desired_fill_level_ms = 20;
  13.  
  14.  
  15. const bool v70_hungry = (splineAckReceived && time_to_go_ms < (int32_t)scan_router_desired_fill_level_ms);
  16. printf("v70_hungry=%u\n", v70_hungry);
  17. printf("time_to_go_ms=%d\n", time_to_go_ms);
  18.  
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 5276KB
stdin
Standard input is empty
stdout
v70_hungry=1
time_to_go_ms=-2