我刚开始学习编程,正在做一本书上的练习题,卡在了求三角形面积的问题上。出现了"不允许使用控制台"的提示。这是由于math.h库引起的吗?
因为同样的代码在online-gdb上完全可以运行。
这里是 launch.json 的内容。
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "gcc - Build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"console": "externalTerminal",
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: gcc build active file",
"miDebuggerPath": "/usr/bin/gdb"
}
]
}
sqrt(mult)
之前要检查mult >= 0
,即它是一个实三角形。 - Weather VaneENOCOFFE
- Antti Haapala -- Слава Україні