Submission
Status:
[PPPPPPPPPP]
Subtask/Task Score:
{100/100}
Score: 100
User: matcherbrainner
Problemset: ตรวจบัตรเครดิต
Language: cpp
Time: 0.002 second
Submitted On: 2026-09-19 21:06:36
#include<bits/stdc++.h>
using namespace std;
int main(){
string code;
cin>>code;
int la=code[15]-'0';
int f=0;
for(int i=0;i<15;i++){
int val=code[i]-'0';
if(i%2==0){
val*=2;
}
f+=(val/10)+(val%10);
}
int s=(10-(f%10))%10;
if(s==la){
cout<<"yes";
}
else{
cout<<"no";
}
}