Submission

Status:

[PPPPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: SRW

Problemset: บาร์โค้ด

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-09 19:46:52

#include <iostream>
#include <string>
using namespace std;
int main(){
    string t;
    cin >> t;
    int even = 0;
    int odd = 0;
    for (int i=11;i>=0;i--){
        if (i%2!=0){
            even += t[i]-'0';
        }
    }
    for (int i=10;i>=0;i--){
        if (i%2==0){
            odd += t[i]-'0';
        }
    }
    int total = (even*3) + odd + t[12]-'0';
    if (total%10 == 0){
        cout << "YES";
    }
    else{
        cout << "NO";
    }
}