Submission
Status:
[-SSSSSSSSS]
Subtask/Task Score:
{0/100}
Score: 0
User: Putter53fr
Problemset: เรียงสตริง
Language: cpp
Time: 0.003 second
Submitted On: 2026-07-02 20:11:25
/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <iostream>
#include <set>
#include <algorithm>
using namespace std;
int main()
{
string n;
cin>>n;
char h = n.back();
n.pop_back();
string b = n;
reverse(b.begin(), b.end());
int c=0;
for (int i=0;i<b.length();i++) {
int d;
string e;
d = b[i] - '0';
if (i % 2 == 0) {
d = d * 2;
}
if (d < 10) {
c += d;
}
else if (d >= 10) {
e = to_string(d);
for (int k=0; k<e.length();k++) {
c += e[k] - '0';
}
}
}
int f = (10 - (c % 10)) % 10;
string g = to_string(f);
if (g[0] == h) {
cout<<"yes";
}
else {
cout<<"no";
}
}