Submission

Status:

Compilation Error

Subtask/Task Score:

Score: 0

User: letdown

Problemset: บาร์โค้ด

Language: cpp

Time: 0.000 second

Submitted On: 2025-10-03 20:15:12

#include <iostream>
#include <math.h>
#include <string.h>

using namespace std;
int main() {
    string s;
    cin >> s;
    reverse(s.begin(), s.end());
    int a = 0, b = 0, l;
    for (int i = 1; i <= 13; i++) {
        int d = int(s[i-1] - '0');
        if (i % 2 == 0) {
            a += d;
        }
        if (i % 2 == 1 && i >= 3) {
            b += d;
        }
    }
    l = int(s[0] - '0');

    if ((3*a+b+l) % 10 == 0) {
        cout << "YES";
    } else {
        cout << "NO";
    }
}