mirror of
https://github.com/theoludwig/programming-challenges.git
synced 2025-05-18 12:02:53 +02:00
feat(solutions): add caesar-cipher/c/function
This commit is contained in:
16
challenges/caesar-cipher/solutions/c/function/solution.c
Normal file
16
challenges/caesar-cipher/solutions/c/function/solution.c
Normal file
@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "character.h"
|
||||
#include "input.h"
|
||||
#include "string.h"
|
||||
|
||||
int main() {
|
||||
char* string = input();
|
||||
int shift;
|
||||
scanf("%d", &shift);
|
||||
string = string_caesar_cipher(string, shift);
|
||||
printf("%s\n", string);
|
||||
free(string);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
Reference in New Issue
Block a user