VC编译问题

来源:百度知道 编辑:UC知道 时间:2024/05/30 19:38:58
#include <stdio.h>
main()
{
int fahr, celsius;
int lower,upper,step;

lower = 0; /*温度表的下限*/
upper = 300; /*温度表的上限*/
step = 20; /*步长*/

fahr = lower;
while (fahr <= upper){
celsius = 5 * (fahr - 32) / 9;
printf("%d\t%d\n", fahr, celsius);
fahr = fahr + step;
}
}
之后按F5 弹出一个像命令提示符的东西
一秒不到就消失了
之后留下

Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
The thread 0x560 has exited with code 12 (0xC).
The program 'F:\我的C程序\Debug\Cpp1.exe' has exited with code 12 (0xC).
请问是什么意思?

你F5没有设断点,当然会执行完毕了。正常。
你可以加system("pause");
或者F9设置断点
#include <stdio.h>
#include <stdlib.h>
main()
{
int fahr, celsius;
int lower,upper,step;

lower = 0; /*温度表的下限*/
upper = 300; /*温度表的上限*/
step = 20; /*步长*/

fahr = lower;
while (fahr <= upper){
celsius = 5 * (fahr - 32) / 9;
printf("%d\t%d\n", fahr, celsius);
fahr = fahr + step;
;
} system("pause");
}