diff options
| author | Bond_009 <bond.009@outlook.com> | 2022-12-01 22:30:22 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2022-12-01 22:30:22 +0100 |
| commit | baf4910870a6e8999802b9a4a22eabd4142a34e3 (patch) | |
| tree | 2d11443dc21e53bd0d99d015cf789937d6d95862 /2020/01/part2.f90 | |
| parent | 49d0c908f24b2c193c9deed1716fe36061ba26a1 (diff) | |
Move all Advent of Codes into one repo
Diffstat (limited to '2020/01/part2.f90')
| -rw-r--r-- | 2020/01/part2.f90 | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/2020/01/part2.f90 b/2020/01/part2.f90 new file mode 100644 index 0000000..b3d6bd2 --- /dev/null +++ b/2020/01/part2.f90 @@ -0,0 +1,27 @@ +program day1 + implicit none + + integer, parameter :: input_len = 200 + integer, parameter :: search = 2020 + + integer :: i, j, k + integer, dimension(input_len) :: input + + open(10, file='input', status='old') + do i = 1, input_len + read(10, *) input(i) + end do + close(10) + + do i = 1, input_len + do j = 1, input_len + do k = 1, input_len + if (input(i) + input(j) + input(k) == search) then + print *, input(i) * input(j) * input(k) + stop + end if + end do + end do + end do + +end program day1 |
