Submission
Status:
[PPPPPPPPPP]
Subtask/Task Score:
{100/100}
Score: 100
User: exoworldgd
Problemset: บาร์โค้ด
Language: cpp
Time: 0.002 second
Submitted On: 2025-05-29 19:23:01
#include <bits/stdc++.h>
using namespace std;
int main(void) {
string a;
cin >> a;
int sum = 0;
for (int i = 0; i < 12; i++) {
int digit = a[i] - '0';
if ((i+1)%2 == 0) sum += digit*3;
else sum += digit;
}
if ((sum + (a[12]-'0')) % 10== 0) cout << "YES";
else cout << "NO";
}