GPT-4 프로그래밍 수준의 99% 라고 해서 로컬에서 간단한 코드들 요청을 해봤는데..
COBOL, FORTRAN 도 할줄 알고,
.Net, Spring 까지 프레임워크도 할줄아네요...
User: "I want to Fibonacci Sequence function in FORTRAN"
NewHope:
Sure, here is a simple implementation of the Fibonacci sequence in FORTRAN.
```Fortran
program fibonacci
implicit none
integer, parameter :: max_count=1000 ! Maximum number of terms to generate
integer :: i, j, count, prev, next, result
call get_int(1, count)
call get_int(2, prev)
call get_int(3, next)
print*, "Fibonacci Series :"
do i=1, count
if(i==1) then
result = prev
elseif(i==2) then
result = next
else
result = prev + next
prev = next
next = result
end if
print*, result
end do
contains
subroutine get_int(prompt, value)
character (len=*), intent(in) :: prompt
integer, intent(out) :: value
print*, prompt
read*, value
end subroutine get_int
end program fibonacci
```
Here is how you can run this program:
1. Save this program in a file called `fibonacci.f90`.
2. In the same directory, create a file called `makefile` and write the following text:
```
program: fibonacci
gfortran -o fibonacci fibonacci.f90
```
3. Run the following command to build and run the program:
```
make
```
The program will prompt you to input the number of terms and it will print the Fibonacci sequence up to that number of terms.