- 不定方程求解
fdv
- @ 2025-4-24 20:43:10
#include <iostream>
#include <vector>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
int ans = 0;
for (int x = 0; x <= c / a; x++) {
for (int y = 0; y <= c / b; y++) {
if (a * x + b * y == c) ans++;
}
}
cout << ans << endl;
return 0;
}
0 条评论
目前还没有评论...
信息
- ID
- 105
- 时间
- ms
- 内存
- MiB
- 难度
- 1
- 标签
- 递交数
- 66
- 已通过
- 46
- 上传者