欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

UVA350-水题

发布时间:2023/12/10 32 豆豆
生活随笔 收集整理的这篇文章主要介绍了 UVA350-水题 小编觉得挺不错的,现在分享给大家,帮大家做个参考.
UVA350-水题 #include<iostream>using namespace std;int main() {int c = 0;int Z, L, I, M;while (cin >> Z >> I >> M >> L){c++;if(Z == L && L == I && I == M && M == 0){return 0;}int i = 1;int K, P;I = I % M;Z = Z % M;K = L;L = P = (Z * L + I) % M;while (K != L){L = (Z * L + I) % M;if(L == P)break;i++;}cout << "Case " << c << ": " << i << endl;}return 0; }

  

posted on 2017-05-10 21:00 好吧,就是菜菜 阅读(...) 评论(...) 编辑 收藏

转载于:https://www.cnblogs.com/shuiyonglewodezzzzz/p/6838096.html

总结

以上是生活随笔为你收集整理的UVA350-水题的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。