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:
parent
953323781c
commit
0893aac35d
@ -1,5 +1,5 @@
|
||||
#ifndef CHARACTER_H
|
||||
#define CHARACTER_H
|
||||
#ifndef __CHARACTER__
|
||||
#define __CHARACTER__
|
||||
|
||||
/**
|
||||
* @brief Append a character to a string, assuming string points to an array
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef INPUT_H
|
||||
#define INPUT_H
|
||||
#ifndef __INPUT__
|
||||
#define __INPUT__
|
||||
|
||||
/**
|
||||
* @brief Read a line from stdin.
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef STRING_H
|
||||
#define STRING_H
|
||||
#ifndef __STRING__
|
||||
#define __STRING__
|
||||
|
||||
#define ALPHABET "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef CHARACTER_H
|
||||
#define CHARACTER_H
|
||||
#ifndef __CHARACTER__
|
||||
#define __CHARACTER__
|
||||
|
||||
/**
|
||||
* @brief Append a character to a string, assuming string points to an array
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef INPUT_H
|
||||
#define INPUT_H
|
||||
#ifndef __INPUT__
|
||||
#define __INPUT__
|
||||
|
||||
/**
|
||||
* @brief Read a line from stdin.
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef STRING_H
|
||||
#define STRING_H
|
||||
#ifndef __STRING__
|
||||
#define __STRING__
|
||||
|
||||
/**
|
||||
* @brief Removes all whitespace from the start of a string.
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef CHARACTER_H
|
||||
#define CHARACTER_H
|
||||
#ifndef __CHARACTER__
|
||||
#define __CHARACTER__
|
||||
|
||||
/**
|
||||
* @brief Append a character to a string, assuming string points to an array
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef INPUT_H
|
||||
#define INPUT_H
|
||||
#ifndef __INPUT__
|
||||
#define __INPUT__
|
||||
|
||||
/**
|
||||
* @brief Read a line from stdin.
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef STRING_H
|
||||
#define STRING_H
|
||||
#ifndef __STRING__
|
||||
#define __STRING__
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
@ -47,13 +47,13 @@ int* prime_numbers_decomposition(int number, int* decomposition_length) {
|
||||
int dividend = number;
|
||||
while (total != number) {
|
||||
int divider = 2;
|
||||
int reste = 0;
|
||||
int remainder = 0;
|
||||
int quotient = 0;
|
||||
do {
|
||||
reste = dividend % divider;
|
||||
remainder = dividend % divider;
|
||||
quotient = dividend / divider;
|
||||
divider++;
|
||||
} while (reste != 0);
|
||||
} while (remainder != 0);
|
||||
divider--;
|
||||
decomposition[*decomposition_length - 1] = divider;
|
||||
*decomposition_length = *decomposition_length + 1;
|
||||
|
Loading…
Reference in New Issue
Block a user