文件名称:D
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:854byte
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
Descr iption
将m个孩子从1到m编上号,按序号围坐成一个圈,从1号孩子开始数,每数到n时,被数到的孩子即离开圈子,然后从下一个孩子开始,再从1开始数,如此不断地数下去,只到只剩下最后一个孩子,问剩下的孩子是几号?
Input
输入为一组整数对,每个整数对占一行,整数对的第一个整数表示m,即孩子的个数,第二个整数表示n,即被数到n的孩子将离开。
0<m<10000, n>0
输入以0 0作为结束。
Output
每组整数对输出一个结果整数,每个输出占一行。
最后一行输入0 0不产生输出。-Descr iption will be m children from 1 to m made on the number, by serial number around a circle, from the beginning of the number of children on the 1st of each number to the n when the number of children to leave the circle, and then from the beginning of a child , from the beginning of a few, so keep going, only that there are only a child, asked the remaining child is a few number? Input integer input for a group of right, each integer on the line, rounded to an integer that the first m, that is, the number of children, the second integer, said n, the n was the number of children will leave. 0 <m <10000, n> 0 input to 0 0 as the end. Output each integer integer output a result, each output line. The last line of input 0 0 does not produce output.
将m个孩子从1到m编上号,按序号围坐成一个圈,从1号孩子开始数,每数到n时,被数到的孩子即离开圈子,然后从下一个孩子开始,再从1开始数,如此不断地数下去,只到只剩下最后一个孩子,问剩下的孩子是几号?
Input
输入为一组整数对,每个整数对占一行,整数对的第一个整数表示m,即孩子的个数,第二个整数表示n,即被数到n的孩子将离开。
0<m<10000, n>0
输入以0 0作为结束。
Output
每组整数对输出一个结果整数,每个输出占一行。
最后一行输入0 0不产生输出。-Descr iption will be m children from 1 to m made on the number, by serial number around a circle, from the beginning of the number of children on the 1st of each number to the n when the number of children to leave the circle, and then from the beginning of a child , from the beginning of a few, so keep going, only that there are only a child, asked the remaining child is a few number? Input integer input for a group of right, each integer on the line, rounded to an integer that the first m, that is, the number of children, the second integer, said n, the n was the number of children will leave. 0 <m <10000, n> 0 input to 0 0 as the end. Output each integer integer output a result, each output line. The last line of input 0 0 does not produce output.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
D.cpp
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.