又是一不懂题

来源:百度知道 编辑:UC知道 时间:2024/05/05 14:43:48
A cyclic number is an integer n digits in length which, when multiplied by any integer from 1 to n, yields a"cycle"of the digits of the original number. That is, if you consider the number after the last digit to "wrap around"back to the first digit, the sequence of digits in both numbers will be the same, though they may start at different positions.For example, the number 142857 is cyclic, as illustrated by the following table:
142857 *1 = 142857
142857 *2 = 285714
142857 *3 = 428571
142857 *4 = 571428
142857 *5 = 714285
142857 *6 = 857142

Input

Write a program which will determine whether or not numbers are cyclic. The input file is a list of integers from 2 to 60 digits in length. (Note that preceding zeros should not be removed, they are considered part of the number and count in determining n. Thus, "01"is a two-digit number, distinct from "1" which is a one-digit number.)

循环数目是一个整数n个位数长度,其中,
当乘以任何整数,从1到n ,
产生了一个"周期"的数字原号码。
也就是说,如果你认为有多少后,最后一位数字为"总结围绕着"回第一位数,
该序列的数字在这两个数字将是一样的,尽管他们可能开始于不同的立场。
举例来说,有多少142857是循环所表明的那样,列于下表:
142857 *1 = 142857
142857 *2 = 285714
142857 *3 = 428571
142857 *4 = 571428
142857 *5 = 714285
142857 *6 = 857142

写一程序将决定是否或不号码循环。输入文件是一个名单整数由2至60个位数的长度。 (注:前零点不应被移走后,他们被认为是部分的数目及计数,在决定n.所以, " 01 "是一个两位数字的号码,有别于" 1 " ,这是一位号码) 。