document project euler till prob 12

This commit is contained in:
Krishna Vedala
2020-06-05 12:20:25 -04:00
parent 8242411530
commit dd40af2736
19 changed files with 230 additions and 84 deletions

View File

@@ -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;

View File

@@ -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;