Submission
Status:
[PPPP-SSSSS]
Subtask/Task Score:
{0/100}
Score: 0
User: 8ii8jj
Problemset: ตรวจบัตรเครดิต
Language: c
Time: 0.002 second
Submitted On: 2025-10-07 19:37:32
#include <stdio.h>
int main(){
char a[16];
scanf("%s",a);
int b=0;
for (int i=0;i<15;i++){
if(i%2==0){
if((a[i]-48)*2>9){
b+=(a[i]-48)*2%10+1;
}
else{
b+=(a[i]-48)*2;
}
}
else{
b+=a[i]-48;
}
}
if(10-(b%10)==a[15]-48){
printf("yes");
}
else{
printf("no");
}
}