Submission

Status:

[PPPPPPPPPP]

Subtask/Task Score:

{100/100}

Score: 100

User: FakeAnutin

Problemset: ตรวจบัตรเครดิต

Language: cpp

Time: 0.004 second

Submitted On: 2026-09-20 20:21:14

#include <bits/stdc++.h>
using namespace std;
int main(){
	int n;
	string s; cin>>s;
	int l = s.size();
	int cc=0;
	for(int i=0;i<l-1;i++){
		if(i%2==0){
		 n = 2*(s[i]-'0');
		if(n >= 10){
			n-=9;
		}}else{
	    	 n = s[i] - '0';
		}
		cc+=n;
	}
	

    if(((10 - (cc%10))%10) == (s[l-1] - '0')){
		cout<<"yes";
	}else{
		cout<<"no";
	}
}