Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: sulinx

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

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-12 12:44:10

#include <bits/stdc++.h>

using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n,m,ans = 0;
    cin >> n >> m;
    for(int i = n;i<m;i++){
        if(i%2 == 0 || i%3==0){
            ans+=i;
        }
    }
    cout << ans;
}