Submission

Status:

PP--------

Subtask/Task Score:

20/100

Score: 20

User: Max

Problemset: ตัวอักษรตัวแรกในคำ

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-13 17:11:31

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main(){
    string word;
    cin >> word;
    char alpa;
    int i, j, len, count;
    len = word.length();
    for (i=0; i<len; i++)
    {
        count = 0;
        alpa = word[i];
        for (j=0; j<len; j++)
        {
            if (alpa == word[j])
                count++;
        }
        if (count > 1)
        {
            word.erase(remove(word.begin(), word.end(), alpa), word.end());
        }
    }
    cout << word[0] << endl;
}