Submission
Status:
[PPPPPPPPPP]
Subtask/Task Score:
{100/100}
Score: 100
User: Athens
Problemset: บาร์โค้ด
Language: cpp
Time: 0.002 second
Submitted On: 2026-09-27 11:08:39
#include <bits/stdc++.h>
using namespace std;
int main(){
string num;
cin >> num;
int s = num.length();
int score1 = 0;
int score2 = 0;
int check = num[12] - '0';
for(int i = 0; i < s - 1 ; i++){
char n = num[i];
int g = n - '0';
if(i % 2 == 0){
score2 += g;
}else if(i % 2 == 1 && i != 0){
score1 += g;
}
}
score1 = score1 * 3;
if((score1 + score2 + check) % 10 == 0){
cout << "YES" << endl;
}else{
cout << "NO" << endl;
}
return 0;
}