文件名称:robot
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:911byte
-
已下载:1次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
机器人的初始坐标为(x,y),(x轴为东西,y为南北)小明的控制的命令如下n,s,w,e分别表示向北,向南,向西,向东走一步,一个步长为一个单位长度。
Input
多组测试数据。每次数据一行,格式为 x y control。x,y为整数(绝对值不超过1000000)表示机器人的初始坐标,control为一个不包含空格的由四个方向字母所组成的控制字串,长度不超过1000
Output
第i组数据输出前,请先输出“Case I:”.
机器人在执行完命令后的坐标位置。
Sample Input
4 2 nnnwwwnnneees
3 5 ssseeessswww
Sample Output
Case 1:
4 7
Case 2:
3 -1
-Robot' s initial coordinates (x, y), (x-axis east-west, y for the North and South) of Hsiao Ming' s control commands are as follows n, s, w, e, respectively north, south, west, east, away step, a step as a unit length. Input multiple sets of test data. Each data line, the format xy control. x, y as integer (absolute value is not more than 1 million) that the initial coordinates of the robot, control does not contain a space for the four directions by the control string consisting of letters, the length does not exceed 1000 Output the first group of data output i , be sure to output " Case I:" . robot finished in the implementation of the order of the coordinates. Sample Input 4 2 nnnwwwnnneees 3 5 ssseeessswww Sample Output Case 1: 4 7 Case 2: 3-1
Input
多组测试数据。每次数据一行,格式为 x y control。x,y为整数(绝对值不超过1000000)表示机器人的初始坐标,control为一个不包含空格的由四个方向字母所组成的控制字串,长度不超过1000
Output
第i组数据输出前,请先输出“Case I:”.
机器人在执行完命令后的坐标位置。
Sample Input
4 2 nnnwwwnnneees
3 5 ssseeessswww
Sample Output
Case 1:
4 7
Case 2:
3 -1
-Robot' s initial coordinates (x, y), (x-axis east-west, y for the North and South) of Hsiao Ming' s control commands are as follows n, s, w, e, respectively north, south, west, east, away step, a step as a unit length. Input multiple sets of test data. Each data line, the format xy control. x, y as integer (absolute value is not more than 1 million) that the initial coordinates of the robot, control does not contain a space for the four directions by the control string consisting of letters, the length does not exceed 1000 Output the first group of data output i , be sure to output " Case I:" . robot finished in the implementation of the order of the coordinates. Sample Input 4 2 nnnwwwnnneees 3 5 ssseeessswww Sample Output Case 1: 4 7 Case 2: 3-1
(系统自动生成,下载前可以参看下载内容)
下载文件列表
robot.c
说明.txt
说明.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.