Submission

Status:

Compilation Error

Subtask/Task Score:

Score: 0

User: Putter53fr

Problemset: เรียงสตริง

Language: cpp

Time: 0.000 second

Submitted On: 2026-07-02 20:16:35

/******************************************************************************

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 <string>
#include <algorithm>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    string n;
    if (!(cin >> n)) return 0;
    int h = n.back() - '0'; 
    n.pop_back();
    string b = n;
    reverse(b.begin(), b.end());

    int c = 0;
    for (int i = 0; i < b.length(); i++) {
        int d = b[i] - '0';
        if (i % 2 == 0) {
            d = d * 2;
        }
        if (d >= 10) {
            c += (d / 10) + (d % 10); 
            c += d;
        }
    }์
    int f = (10 - (c % 10)) % 10;
    if (f == h) {
        cout << "yes\n";
    } else {
        cout << "no\n";
    }

    return 0;
}