win7下安装VC++6.0,也已安装Easyx,为什么还会出现编译错误,如图: C新手,请高手指教,谢谢。
程序:#include<math.h>#include<graphics.h>main(){intx0=320,y0=240;intn=25,i,j,r=180;intx...
程序:
#include <math.h>
#include <graphics.h>
main()
{
int x0 = 320, y0 = 240;
int n = 25, i, j, r = 180;
int x[50], y[50];
int gdriver = DETECT, gmode;
initgraph(&gdriver, &gmode, ""); /*图形方式初始化*/
cleardevice(); /*清屏*/
setbkcolor(WHITE); /*设置背景颜色为白色*/
setcolor(GREEN); /*设置绘图颜色为绿色*/
for (i = 0; i < n; i++)
{
x[i] = r * cos(2 *3.1415926 * i / n) + x0; /*确定横坐标*/
y[i] = r * sin(2 *3.1415926 * i / n) + y0; /*确定纵坐标*/
}
for (i = 0; i <= n - 2; i++)
{
for (j = i + 1; j <= n - 1; j++)
line(x[i], y[i], x[j], y[j]); /*将上面确定的各点之间进行连线*/
}
getch();
closegraph(); /*退出图形界面*/
}
编译出错提示:
fatal error C1083: Cannot open include file: 'graphics.h': No such file or directory 展开
#include <math.h>
#include <graphics.h>
main()
{
int x0 = 320, y0 = 240;
int n = 25, i, j, r = 180;
int x[50], y[50];
int gdriver = DETECT, gmode;
initgraph(&gdriver, &gmode, ""); /*图形方式初始化*/
cleardevice(); /*清屏*/
setbkcolor(WHITE); /*设置背景颜色为白色*/
setcolor(GREEN); /*设置绘图颜色为绿色*/
for (i = 0; i < n; i++)
{
x[i] = r * cos(2 *3.1415926 * i / n) + x0; /*确定横坐标*/
y[i] = r * sin(2 *3.1415926 * i / n) + y0; /*确定纵坐标*/
}
for (i = 0; i <= n - 2; i++)
{
for (j = i + 1; j <= n - 1; j++)
line(x[i], y[i], x[j], y[j]); /*将上面确定的各点之间进行连线*/
}
getch();
closegraph(); /*退出图形界面*/
}
编译出错提示:
fatal error C1083: Cannot open include file: 'graphics.h': No such file or directory 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询