Submission

Status:

[-SSSSSSSSS]

Subtask/Task Score:

{0/100}

Score: 0

User: andamanlnwza007

Problemset: บาร์โค้ด

Language: cpp

Time: 0.003 second

Submitted On: 2025-10-02 20:15:47

#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main(){
	int sumcheck1=0 ,sumcheck2=0,d=0;
	string bar,d1;
	cin>>bar;
	reverse(bar.begin(),bar.end());
	for (int i =0 ; i<13 ; i++){
		if((i+1)%2==0){
			d = stoi(bar.substr(i,1));
			sumcheck1+=d;
		}
		else if((i+1)%2!=0 and i>1){
			d1 = bar.substr(i,1);
			d = stoi(d1);
			sumcheck2+=d;
		}
	}
	sumcheck1*=3;
	string d2 = bar.substr(0,1);
	int digit = stoi(d2);
	if (sumcheck1+sumcheck2+digit == 100){
		cout<<"YES";
	}
	else {
		cout<<"NO";
	}
	
}