文件名称:a-questopn
介绍说明--下载内容均来自于网络,请自行研究使用
公元13世纪上半叶,蒙古军队一路西征杀向欧洲。在进军途中,蒙古骑兵以旗为单位沿一条道路相继开进。为了给后面的队伍指路,每当遇到一个道路分叉处时,就在路旁堆石头堆作路标,堆一堆石头表示直行,堆两堆石头表示右转,堆三堆石头表示左转。试用C语言编写一个程序,计算出通过的路口数目。假设每个相邻路口间路段的长度基本相等且开始的方向向西(以此判断第一个路口,即出发时向哪个方向走),用输出eswn四个字母或其组合来确定最终的地点相对于出发地(即第一个路口)的方位。
输入:只有一行,分别用1、2和3表示路口遇到的石碓的数量,最多有20个路口。
输出:只有一行,由一个数字和一个字母或两个字母组合分别构成路口的数目和最终地点与出发地的方位。如果需要输出两个字母,则输出字母按照字典序输出。
输入样例:
31
输出样例:
2,s
输入样例:
131
输出样例:
3,sw
-Half of the 13th century, the Mongol army expedition to kill all the way to Europe. Mongol horsemen to the flag in the march on the way, as a unit along a road successively entered. For guiding the team to back, turn right whenever encountered a road at the bifurcation on the roadside heap heap of stones as a signpost to heap a pile of stones, said straight heap piles of stones heap Sandui stone left turn. Trial C language to write a program, calculated by the number of junctions. Assuming the length of the section between each adjacent junctions basic equal direction westward (the beginning of the first intersection to judge, that is starting to which direction to go), output eswn four letters or a combination thereof to determine the final location From (ie intersection) relative to the orientation.
Input: only one line, respectively, with 1, 2 and 3 represents the intersection encountered stone pestle number, up to 20 junctions.
Output: only one line, the form number of the inte
输入:只有一行,分别用1、2和3表示路口遇到的石碓的数量,最多有20个路口。
输出:只有一行,由一个数字和一个字母或两个字母组合分别构成路口的数目和最终地点与出发地的方位。如果需要输出两个字母,则输出字母按照字典序输出。
输入样例:
31
输出样例:
2,s
输入样例:
131
输出样例:
3,sw
-Half of the 13th century, the Mongol army expedition to kill all the way to Europe. Mongol horsemen to the flag in the march on the way, as a unit along a road successively entered. For guiding the team to back, turn right whenever encountered a road at the bifurcation on the roadside heap heap of stones as a signpost to heap a pile of stones, said straight heap piles of stones heap Sandui stone left turn. Trial C language to write a program, calculated by the number of junctions. Assuming the length of the section between each adjacent junctions basic equal direction westward (the beginning of the first intersection to judge, that is starting to which direction to go), output eswn four letters or a combination thereof to determine the final location From (ie intersection) relative to the orientation.
Input: only one line, respectively, with 1, 2 and 3 represents the intersection encountered stone pestle number, up to 20 junctions.
Output: only one line, the form number of the inte
(系统自动生成,下载前可以参看下载内容)
下载文件列表
a question about lukou.c