summaryrefslogtreecommitdiff
path: root/1/part2.f90
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2020-12-10 21:25:43 +0100
committerBond_009 <bond.009@outlook.com>2020-12-10 21:25:43 +0100
commit4454a3060b525e274a1c4bfd7c3d4b9224668461 (patch)
treee6d7434ab0215fe6a9912cf8feba31374dfc9022 /1/part2.f90
parent1d2a7c90f666fa4fb87f81373ed690fc6c11e4e1 (diff)
Change .f95 to .f90
Diffstat (limited to '1/part2.f90')
-rw-r--r--1/part2.f9027
1 files changed, 27 insertions, 0 deletions
diff --git a/1/part2.f90 b/1/part2.f90
new file mode 100644
index 0000000..b3d6bd2
--- /dev/null
+++ b/1/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