You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -528,14 +528,12 @@ for i in reverse(100):
528
528
</pre>
529
529
530
530
* * *
531
-
532
-
Question:
531
+
**Question:**
533
532
A robot moves in a plane starting from the original point (0,0). The robot can move toward UP, DOWN, LEFT and RIGHT with a given steps. The trace of robot movement is shown as the following:
534
533
UP 5
535
534
DOWN 3
536
535
LEFT 3
537
536
RIGHT 2
538
-
��
539
537
The numbers after the direction are steps. Please write a program to compute the distance from current position after a sequence of movement and original point. If the distance is a float, then just print the nearest integer.
540
538
Example:
541
539
If the following tuples are given as input to the program:
0 commit comments