Hi all,
I am trying to do the problem 4 of the Euler project.
My approach is to convert the number to a string and compare the last half with the first half.
However, I am having trouble converting a number to a string. Here is my code so far ( ifort -O3 )
PROGRAM pr4
IMPLICIT NONE
INTEGER(KIND=4) :: number_1,number_2,product_of_numbers
INTEGER(KIND=4),PARAMETER :: lower_limit=10,upper_limit=99
CHARACTER(LEN=:),ALLOCATABLE :: palindrome_check_string
DO number_1 = lower_limit,upper_limit
DO number_2 = lower_limit,upper_limit
product_of_numbers = number_1 * number_2
WRITE(palindrome_check_string,*) product_of_numbers
DEALLOCATE(palindrome_check_string)
END DO
END DO
END PROGRAM pr4
The code compiles, however returns an error.
Hereās the error:
forrtl: severe (66): output statement overflows record, unit -5, file Internal List-Directed Write
Image PC Routine Line Source
pr4 000000000042BCC9 Unknown Unknown Unknown
pr4 000000000040FAFE Unknown Unknown Unknown
pr4 000000000040DCC3 Unknown Unknown Unknown
pr4 0000000000403918 Unknown Unknown Unknown
pr4 0000000000403862 Unknown Unknown Unknown
libc.so.6 00007F69C9829510 Unknown Unknown Unknown
libc.so.6 00007F69C98295C9 __libc_start_main Unknown Unknown
pr4 0000000000403765 Unknown Unknown Unknown