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

19 lines
400 B
C

#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "character.h"
#include "input.h"
#include "string.h"
int main() {
char* string = input();
string_to_uppercase(string);
string_remove_character(string, ' ');
bool is_palindrome = string_is_palindrome(string);
free(string);
printf("%s\n", is_palindrome ? "true" : "false");
return EXIT_SUCCESS;
}