Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: Ratthathammanoon
Problemset: ตัวอักษรตัวแรกในคำ
Language: cpp
Time: 0.003 second
Submitted On: 2025-10-12 23:19:14
#include <stdio.h>
#include <string.h>
void sort(char *P){
char temp;
for(int i=0;i<strlen(P);i++){
for(int j=0;j<strlen(P);j++){
if(P[i]<P[j]){
temp = P[i];
P[i] = P[j];
P[j] = temp;
}
}
}
}
int main(){
char A[20],F[20];
int found=0,k=0;
scanf("%s",A);
for(int i=0;i<strlen(A);i++){
found = 0;
for(int j=0;j<strlen(A);j++){
if(i==j){
continue;
}
if(A[i]==A[j]){
found=1;
}
}
if(found==0){
F[k++]=A[i];
}
}
F[k] = '\0';
sort(F);
printf("%c",F[0]);
}