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

refactor(solutions): headers file in C

This commit is contained in:
Divlo 2021-10-19 09:37:49 +02:00
parent 953323781c
commit 0893aac35d
No known key found for this signature in database
GPG Key ID: 6F24DA54DA3967CF
10 changed files with 21 additions and 21 deletions

View File

@ -1,5 +1,5 @@
#ifndef CHARACTER_H #ifndef __CHARACTER__
#define CHARACTER_H #define __CHARACTER__
/** /**
* @brief Append a character to a string, assuming string points to an array * @brief Append a character to a string, assuming string points to an array

View File

@ -1,5 +1,5 @@
#ifndef INPUT_H #ifndef __INPUT__
#define INPUT_H #define __INPUT__
/** /**
* @brief Read a line from stdin. * @brief Read a line from stdin.

View File

@ -1,5 +1,5 @@
#ifndef STRING_H #ifndef __STRING__
#define STRING_H #define __STRING__
#define ALPHABET "ABCDEFGHIJKLMNOPQRSTUVWXYZ" #define ALPHABET "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

View File

@ -1,5 +1,5 @@
#ifndef CHARACTER_H #ifndef __CHARACTER__
#define CHARACTER_H #define __CHARACTER__
/** /**
* @brief Append a character to a string, assuming string points to an array * @brief Append a character to a string, assuming string points to an array

View File

@ -1,5 +1,5 @@
#ifndef INPUT_H #ifndef __INPUT__
#define INPUT_H #define __INPUT__
/** /**
* @brief Read a line from stdin. * @brief Read a line from stdin.

View File

@ -1,5 +1,5 @@
#ifndef STRING_H #ifndef __STRING__
#define STRING_H #define __STRING__
/** /**
* @brief Removes all whitespace from the start of a string. * @brief Removes all whitespace from the start of a string.

View File

@ -1,5 +1,5 @@
#ifndef CHARACTER_H #ifndef __CHARACTER__
#define CHARACTER_H #define __CHARACTER__
/** /**
* @brief Append a character to a string, assuming string points to an array * @brief Append a character to a string, assuming string points to an array

View File

@ -1,5 +1,5 @@
#ifndef INPUT_H #ifndef __INPUT__
#define INPUT_H #define __INPUT__
/** /**
* @brief Read a line from stdin. * @brief Read a line from stdin.

View File

@ -1,5 +1,5 @@
#ifndef STRING_H #ifndef __STRING__
#define STRING_H #define __STRING__
#include <stdlib.h> #include <stdlib.h>

View File

@ -47,13 +47,13 @@ int* prime_numbers_decomposition(int number, int* decomposition_length) {
int dividend = number; int dividend = number;
while (total != number) { while (total != number) {
int divider = 2; int divider = 2;
int reste = 0; int remainder = 0;
int quotient = 0; int quotient = 0;
do { do {
reste = dividend % divider; remainder = dividend % divider;
quotient = dividend / divider; quotient = dividend / divider;
divider++; divider++;
} while (reste != 0); } while (remainder != 0);
divider--; divider--;
decomposition[*decomposition_length - 1] = divider; decomposition[*decomposition_length - 1] = divider;
*decomposition_length = *decomposition_length + 1; *decomposition_length = *decomposition_length + 1;