Submission

Status:

[-SSSSSSSSS]

Subtask/Task Score:

{0/100}

Score: 0

User: mocngaijakraila

Problemset: บาร์โค้ด

Language: cpp

Time: 0.002 second

Submitted On: 2026-07-25 08:36:08

#include<bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);

    string t; cin >> t;
    int n1 = 0, n2 = 0, k = 0;

    for(int i = t.length()-1; i > -1 ; i--) {
        if(i % 2 == 1) {
            n1 += t[i];
        }
        else {
            if(i != t.length() - 1) {
                n2 += t[i];
            }
            else k = t[i];
        }
    }
    bool c;
    c =  ((n1 + n2 + k) % 10 == 0) ? true : false;

    if(c) cout << "YES";
    else cout << "NO";
    
    return 0;
}