Submission

Status:
PPPPPPPPPP

Score: 100

User: okji15019

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

Language: cpp

Time: 0.001 second

Submitted On: 2024-10-16 22:37:05

#include <stdio.h>
#include <string.h>
#include <math.h>

int main() {
	char text[21], check;
	int i,j,x;
	scanf("%s", &text);
	for (i=0;i<26;i++) {
		x = 0;
		int check = 'A' + i;
		for (j=0;j<strlen(text);j++) {
			if (check == text[j]) {
				x++;
			}
		}
		if (x==1) {
			printf("%c", check);
			break;
		}
	}
	return 0;
}