1
1
mirror of https://github.com/theoludwig/programming-challenges.git synced 2024-11-09 22:08:58 +01:00
programming-challenges/challenges/first-non-repeating-character/solutions/c/function/solution.c

20 lines
356 B
C
Raw Normal View History

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "character.h"
#include "input.h"
#include "string.h"
int main() {
char* string = input();
char character = string_first_non_repeating_character(string);
if (character == 0) {
printf("\n");
} else {
printf("%c\n", character);
}
free(string);
return EXIT_SUCCESS;
}