Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: letdown

Problemset: ผลรวมตัวเลข

Language: cpp

Time: 0.003 second

Submitted On: 2025-10-02 19:38:13

#include <iostream>
#include <math.h>
#include <string.h>

using namespace std;
int main() {
    int n, m, ans=0;
    cin >> n >> m;

    for (n; n < m; n++) {
        if (n % 2 == 0) {
            ans += n;
        } else if (n % 3 == 0) {
            ans += n;
        }
    }

    cout << ans;
}