我不理解//#1250倍数

Kinghero King of the summit 2022-07-02 22:00:12 0
#include <iostream>
using namespace std;
int main() {
    int a, b, n, sn;
    cin >> a >> b >> n;
    for (int i = 1; i <= n; i++) {
        if (i % a == 0 || i % b == 0) {
            sn++;
        }
    }
    cout << sn;
    return 0;
}
{{ vote && vote.total.up }}

共 1 条回复

root 站长

sn = 0