Submission
Status:
[PPPPPPPPPP]
Subtask/Task Score:
{100/100}
Score: 100
User: tha_smith
Problemset: บาร์โค้ด
Language: cpp
Time: 0.003 second
Submitted On: 2025-10-02 20:59:59
#include <iostream>
#include <string>
using namespace std;
int main() {
string n;
int even=0,odd=0;
cin >> n;
for(int i=0;i<=11;i++) {
if(i%2==0) {
odd+=(n[i]-'0');
}
else if(i%2==1) {
even+=(n[i]-'0');
}
}
even = even*3;
int num = even+odd+(n[12]-'0');
if(num%10==0) {
cout << "YES";
}
else {
cout << "NO";
}
}