Submission
Status:
[PPPPPPPPPP]
Subtask/Task Score:
{100/100}
Score: 100
User: emipp
Problemset: บาร์โค้ด
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-10 00:11:36
#include<iostream>
using namespace std ;
int main () {
char arr[14] ;
cin >> arr ;
int a = 0 ;
int b = 0 ;
int y = 0 ;
int h ;
for (int i = 11 ; 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[12]-48))%10 == 0 )
cout << "YES" ;
else
cout << "NO" ;
return 0 ;
}