Submission

Status:

[PPPPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: idkstering321

Problemset: บาร์โค้ด

Language: cpp

Time: 0.002 second

Submitted On: 2026-09-30 17:29:14

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

int main(){
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    string n;
    int total = 0, even = 0, odd = 0;
    cin >> n;
    for(int i = 0; i < 12; i++){
        if(i % 2 == 0){
            odd+=(n[i]-'0');
        }
        else if(i % 2 == 1){
            even+=(n[i]-'0');
        }
    }
    even*=3;
    total = even+odd;
    if((total+(n[12]-'0'))%10 == 0){ cout << "YES"; }
    else{ cout << "NO"; }
    return 0;
}