Submission
Status:
[PPPPPPPPPP]
Subtask/Task Score:
{100/100}
Score: 100
User: I_am_me
Problemset: บาร์โค้ด
Language: cpp
Time: 0.003 second
Submitted On: 2025-09-23 20:04:11
#include<iostream>
#include<cstring>
using namespace std;
int main() {
string code;
cin >> code;
int count1=0, count2=0;
for (int i = 12; i > 1; i -= 2) {
count1 += code[i-1] - 48;
}
for (int j = 11; j >= 1; j -= 2) {
count2 += code[j - 1] - 48;
}
int count = count1*3 + count2;
if ((count + (code[12]-48)) % 10 == 0) {
cout << "YES";
}
else {
cout << "NO";
}
}