#include#include using namespace std;int n, ans, i, j;string s;charget(inti){\tif (i < n)\t\treturn s[i];\telse\t\treturn s[i-n];}int main(){\tcin>>s;\tn = s.size();\tans = 0;\tfor (i = 1; i <= n-1; i )\t{\t\tfor (j = 0; j <= n-1; j ) if (get(i j) < get(ans j))\t\t{\t\t\tans = i;\t\t\tbreak;\t\t}\t\telse if (get(i j) > get(ans j))\t\t\tbreak;\t}\tfor (j = 0; j <= n-1; j )\t\tcout<
输入: CBBADADA
输出:
发表评论 取消回复