mirror of
https://github.com/TheAlgorithms/C.git
synced 2026-05-19 08:20:46 +00:00
document project euler till prob 12
This commit is contained in:
@@ -1,6 +1,17 @@
|
||||
/**
|
||||
* \file
|
||||
* \brief [Problem 8](https://projecteuler.net/problem=8) solution
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/** Compute the product of two numbers in a file
|
||||
*
|
||||
* \param[in] fp pointer to file that is already open
|
||||
* \param[in] start_pos line number of the first numer
|
||||
* \param[in] num_digits number of digits on the line to multiply
|
||||
* \returns expected product
|
||||
*/
|
||||
long long int get_product(FILE *fp, long start_pos, int num_digits)
|
||||
{
|
||||
char ch = ' '; /* temporary variable to store character read from file */
|
||||
@@ -46,6 +57,7 @@ long long int get_product(FILE *fp, long start_pos, int num_digits)
|
||||
return prod;
|
||||
}
|
||||
|
||||
/** Main function */
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int position = 0;
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
/**
|
||||
* \file
|
||||
* \brief [Problem 8](https://projecteuler.net/problem=8) solution
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h> /* for memmove */
|
||||
|
||||
/** Main function */
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int position = 0, num_bad_chars = 0;
|
||||
|
||||
Reference in New Issue
Block a user