Home > Back-end > For Tom and Jerry (presumably so called)
For Tom and Jerry (presumably so called)
Time:09-18
QiQi recently fell in love with Tom and Jerry, and then do a about Tom and Jerry's dream, a dream is like that, in a infinite long straight road, chasing Jerry Tom in the beginning, Jerry from Tom n m (n & gt; 0), Tom make track for to Jerry, Tom's speed is v1m/s, Jerry, Jerry speed for v2m/s, (v1 v2, are no less than 0) Jerry have a cheating artifact, it can use the ground plate to make Tom pause 1 s after it, but after the dishes from the beginning comes once every 5 seconds (0 seconds without plate), would you please guess to Jerry, Tom?
input format: Input number three, respectively is n, v1 and v2, respectively at the beginning of the distance of the Tom and Jerry, v1, v2 says Tom and Jerry running speed, the initial value is 100,
output format: If Tom chased to Jerry, output "Jerry GG!" Otherwise, output "Jerry win!"
input sample: Given a set of input here, for example:
42 68 35 79, 59, 63 The output sample: Here is given the corresponding output, for example:
Jerry GG! Jerry win!
CodePudding user response:
Try this program can pass the test? # include & lt; stdio.h> Int main () { Int n, v1, v2, While (the scanf (" % d % d % d ", & amp; N, & amp; V1, & amp; V2)==3) { If (5 * v1, v2) (n + 5 * & gt;=0) Printf (" Jerry GG! \n"); Else if ((n + 6 * v2) - 5 * v1 & gt; N) Printf (" Jerry win! \n"); } return 0; }