You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
507 B
35 lines
507 B
#include <stdio.h>
|
|
|
|
#include <input.h>
|
|
|
|
#include <result.h>
|
|
|
|
extern int part1(result_t* restrict);
|
|
extern int part2(result_t* restrict);
|
|
|
|
static void print_result(int part, result_t r)
|
|
{
|
|
#ifdef DEBUG
|
|
printf(">>> [%d] %lu\n", part, r);
|
|
#else
|
|
(void)part;
|
|
printf("%ld\n", r);
|
|
#endif
|
|
}
|
|
|
|
int main()
|
|
{
|
|
int r = 0;
|
|
#ifdef _PART1
|
|
result_t p1;
|
|
if( (r = part1(&p1)) ) return r;
|
|
print_result(1, p1);
|
|
#endif
|
|
#ifdef _PART2
|
|
result_t p2;
|
|
if( (r = part2(&p2)) ) return r;
|
|
print_result(2, p2);
|
|
#endif
|
|
return r;
|
|
}
|