Submission
Status:
[PPPPPPPPPP]
Subtask/Task Score:
{100/100}
Score: 100
User: korn234
Problemset: บาร์โค้ด
Language: cpp
Time: 0.002 second
Submitted On: 2026-10-12 21:38:48
#include <iostream>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
string n;
cin>>n;
int check=n[12]-'0';
int even=0, odd=0;
for (int i=1; i<13; i+=2){
even+=n[i]-'0';
}
for (int i=0; i<11; i+=2){
odd+=n[i]-'0';
}
even*=3;
int sum=0;
sum=even+odd+check;
if (sum%10==0){
cout<<"YES";
}
else {
cout<<"NO";
}
}