文章
68
粉丝
691
获赞
26
访问
578.3k
int main() { int a, b, c, d; while (cin >> a >> b >> c >> d) { int sign = -1; for (int i = 0; i < MAX && -1==sign; i++) { int t = b + a * i - d; if (t%c == 0)sign = i; } if (sign == -1)cout << -1 << endl; else cout << b + a * sign << endl; } }
登录后发布评论
暂无评论,来抢沙发