在dev-cpp怎么输出结果

来源:百度知道 编辑:UC知道 时间:2024/06/07 01:20:42
#include<stdio.h>
main(){
int a,b;
int min,max.m;
min=0;
max=300;
m=20;
while(a<=max){
b=5*(a-27)/9;
printf("d%\t%d\n",a,b);
a=a+m;
}
}
怎么输出结果啊? 我用的dev-cpp.

只要你写的这个程序在编译的时候通过了就可以正常的运行了
只不过在用DEV的时候可通看不到结果
你在写的时候在最开始加上#include<conio.h>
然后在结尾的时候加上getch();就可以看到结果了
如果你要用的是VC++的编程环境的话就不运加这个了

如果程序里面有scanf,及其输入语句的话,要在结尾加两个
getchar();
getchar();
如果没有输入语句的话,要一个getchar();
另外,程序要写成这样

#include<stdio.h>
int main(void)
{

//code ....
getchar();
getchar();一个或两个,具体情况看上面说明
return 0;

}

main的有大括号前加一句system("pause");就能看到结果了

在return 0;前加一个getch();包含头文件#include<conio.h>

或者加system("pause");包含头文件#include<stdlib.h>

你没有给a赋值,所以a中是垃圾数。如果要输出,在头文件声明时加入#include <stdlib.h>然后在结束前加上system("pause");return 0;还有main函数前应有 int,函数返回值为零代表程序正常结束