Submission
Status:
[-SSSSSSSSS]
Subtask/Task Score:
{0/100}
Score: 0
User: emipp
Problemset: บาร์โค้ด
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-09 23:53:44
#include<iostream>
using namespace std ;
int main () {
char arr[14] ;
cin >> arr ;
int a = 0 ;
int b = 0 ;
int y = 0 ;
for (int i = 12 ; i>= 0 ; i--){
if (i%2 != 0){
a = a+(arr[i]-48) ;
}
}
for (int j = 10 ; j>=0 ; j--){
if(j%2==0){
b = b+(arr[j]-48) ;
}
}
y = (a*3) + b ;
if ((y+(arr[1]-48)) %10 == 0){
cout << "YES" ;}
else {
cout << "NO" ;
}
return 0 ;
}