UVa 550 Multiplying by Rotation

这题到底是啥意思啊?》线性同余也不是,好像不是数论里面的内容啊,怎么都看不懂它是在搞什么东西的

看了别人的题解,写的代码

View Code
#include<iostream>
using namespace std;
int main()
{
    int k, m, n;
    while(cin >> k >> m >> n)
    {
        int cnt=1;
        int s=m*n;
        while(s != m)
        {
            s=s%k*n+s/k;
            cnt++;
        }
        cout << cnt << endl;
    }
    return 0;
}
原文地址:https://www.cnblogs.com/SDUTYST/p/2618432.html