Submission

Status:
-P-P---P--

Score: 30

User: exoworldgd

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

Language: cpp

Time: 0.002 second

Submitted On: 2024-12-14 17:41:01

#include <bits/stdc++.h>
using namespace std;
int main(void) {
    int a,b,sum = 0;
    cin >> a >> b;
    set<int> m;
    for (int i = a; i <= b; i++) if (i % 2 == 0 || i % 3 == 0) m.insert(i);
    for (auto i : m) sum += i;
    cout << sum;
}