advent2021

Advent of Code 2021 Solutions
git clone git://bsandro.tech/advent2021
Log | Files | Refs | README | LICENSE

main.c (439B)


      1 #include <stdio.h>
      2 #include <time.h>
      3 #include <string.h>
      4 
      5 void puzzle(const char *filename);
      6 
      7 int main(int argc, char *argv[]) {
      8 	printf("Advent of Code: day 13\n");
      9 	double time_start = clock();
     10 
     11 	if (argc <= 1) {
     12 		printf("Usage: %s inputfile.txt\n", argv[0]);
     13 		return -1;
     14 	}
     15 
     16 	const char *filename = argv[1];
     17 	puzzle(filename);
     18 
     19 	double elapsed = clock() - time_start;
     20 	printf("Elapsed: %f\n", elapsed / CLOCKS_PER_SEC);
     21 
     22 	return 0;
     23 }