Robot
|
|
题目描述
PY喜欢玩机器人,他最近做了一台性能卓越、超乎想象的机器人,只可惜他有一个问题没有解决——这个机器人不会动。他想要让机器人动起来,所以他先要写一个控制机器人的程序。你作为PY的专属IT民工,很荣幸的接到了这个任务。PY给了你一个类Robot,请你把它实现。 类的定义如下: struct Position { class Robot {
注意本题中,'N','E','S','W'分别代表向上,右,下,左。
样例输出
0 00 11 11 20 20 1
提示
只需要提交类的定义和实现,不需要提交main函数。 #include <iostream> using namespace std; struct Position { // your code will be here int main() {
|