// Multiply the large numbers! Check whether the last digit is in the correct position! # Include <iostream> # include <cstdio> # include <string> # include <algorithm> using namespace STD; int ans [100]; int main () {string STR; int input [70], TMP [70]; int I, J, K, Len; bool flag1; while (CIN> Str) {Len = Str. length (); flag1 = false; for (I = len-1, j = 0; I> = 0; I --, J ++) {input [J] = STR [I]-48; TMP [J] = input [J];} Sort (TMP, TMP + J); for (I = 1; I <= Len; I ++) {If (flag1) break; memset (ANS, 0, sizeof (ANS); For (j = 0; j <Len; j ++) {ans [J] + = input [J] * I; if (ANS [J] >=10) {ans [J + 1] + = ans [J]/10; ans [J] % = 10 ;}} if (ANS [J]> = 10) {ans [J + 1] + = ans [J]/10; ans [J] % = 10; j ++ ;} sort (ANS, ANS + J); For (k = 0; k <j; k ++) {If (TMP [k]! = Ans [k]) {flag1 = true; break ;}} if (flag1) break;} If (flag1) cout <STR <"is not cyclic" <Endl; else cout <STR <"is cyclic" <Endl;} system ("pause ");}