C++ 找出三个数的最小公倍数加1 的前10个整数
#include<iostream>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
int count = 0;
int num = 1;
while (count < 10) {
if (num % a == 1 && num % b == 1 && num % c == 1) {
cout << num << ' ';
count++;
}
num++;
}
return 0;
}
原文地址: https://www.cveoy.top/t/topic/i7HW 著作权归作者所有。请勿转载和采集!