summaryrefslogtreecommitdiff
path: root/1/part1.f95
blob: a7c09c8d0019134bb7f6a37e5a88dbeeae4e468a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
program day1
    implicit none

    integer, parameter :: input_len = 200
    integer, parameter :: search = 2020

    integer :: i, j
    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
            if (input(i) + input(j) == search) then
                print *, input(i) * input(j)
                stop
            end if
        end do
    end do

end program day1