Submission

Status:

[PPPPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: rice_ot

Problemset: บาร์โค้ด

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-14 10:24:37

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

int main(){

    string x; cin>>x;
    int evn = 0, tot = 0;
    for(int i = x.length()-1; i>= 0; i--){
        if((i+1)%2 == 0){
            evn+=x[i]-'0';
        }
        else{
            tot+=x[i]-'0';
        }
    }
    if((evn*3+tot)%10 == 0) cout<<"YES";
    else cout<<"NO";
}