Mercurial > coderloop
view src/euler6.f @ 0:307a81e46071 tip
initial committ
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Tue, 18 Oct 2011 01:17:49 -0700 |
parents | |
children |
line wrap: on
line source
1 program euler63 implicit none4 character (len = 100) :: file_name5 integer, parameter :: big = selected_int_kind(11)6 integer (kind = big) :: n,ans7 call getarg( 1, file_name )8 OPEN(unit = 7, file = file_name)9 read (7,*) n11 ans = ((n * (n + 1))/2)**2 - ((n * (n + 1) * (1 + ( 2 * n)))/6)13 write (unit = *, fmt = "(I0)") ans18 end program euler6