test.f90
PROGRAM add_numbers
implicit none
REAL :: a, b, av1, av2, c
PRINT *, 'Input 2 numbers:'
READ (*,*) a, b
av1 = (a + b)/2; av2 = (a*b)**0.5
PRINT *, 'Arithmetic mean: ', av1
PRINT *, 'Geometric mean: ', av2
READ (*,*) c
END
PROGRAM add_numbers
implicit none
REAL :: a, b, av1, av2, c
PRINT *, 'Input 2 numbers:'
READ (*,*) a, b
av1 = (a + b)/2; av2 = (a*b)**0.5
PRINT *, 'Arithmetic mean: ', av1
PRINT *, 'Geometric mean: ', av2
READ (*,*) c
END
.vscode\
launch.json
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Lunch(GDB)",
"type": "cppdbg",
"request": "launch",
"targetArchitecture": "x86",
"program": "${workspaceRoot}\\${fileBasenameNoExtension}.exe",
"miDebuggerPath": "gdb.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"externalConsole": true,
"preLaunchTask": "gfortran"
},
{
"name": "Intel Debug Attach",
"type": "cppvsdbg",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
.vscode\tasks.json
{
"version": "2.0.0",
"command": "gfortran",
"args": [
"-g",
"${file}",
"-o",
"${workspaceRoot}\\${fileBasenameNoExtension}.exe"
]
}