Submission

Status:

[PPPPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: fillhavertz

Problemset: บาร์โค้ด

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-13 10:51:30

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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string str;
    cin>>str;
    int check;
    int odd =0;
    int even=0;
    int i=1;
    for(char c:str){
        if(i==13) check = c-'0';
        else if(i++%2) odd += c-'0';
        else even += c-'0';
    }int sum = (even*3)+odd+check;
    
    //cout<<sum<<' '<<odd<<' '<<even<<endl;
    if(!(sum%10))cout<<"YES";
    else cout<<"NO";

    return 0;
}