Submission
Status:
[PPPPPPPPPP]
Subtask/Task Score:
{100/100}
Score: 100
User: thanainan
Problemset: บาร์โค้ด
Language: cpp
Time: 0.002 second
Submitted On: 2025-09-21 15:58:17
#include <bits/stdc++.h>
using namespace std;
int main()
{
string N;
int x1,x2;
cin>>N;
int n[N.length()];
for(int i=N.length()-1;i>=0;i--){
n[i] = N[N.length()-i-1]-'0';
}
x1=0;
x2=0;
for(int i=0;i<N.length();i++){
if(i%2==1){
x1=x1+n[i];
}
else{
x2=x2+n[i];
}
}
x1=x1*3;
if((x1+x2)%10==0){
cout<<"YES";
}
else{
cout<<"NO";
}
}