(美丽的宝石图案 ) 我在DEV-C++通不过编译
我不大懂,请大家帮我看看,到底是哪里出了错,我的DEV-C++放在 F:\新建文件夹\Dev-Cpp#include<math.h>
#include<graphics.h>
main()
{
float t;
int x0=320,y0=240;
int n,i,j,r;
int x[50],y[50];
int gdriver=DETECT,gmode;
printf("input n(23-31)and r(100-200)\n");
scanf("%d%d",&n,&r);
initgraph(&gdriver,&gmode,"");
cleardevice();
setbkcolor(WHITE);
setcolor(RED);
t=6.28318/n;
for(i=0;i<n;i++)
{
x[i]=r*cos(i*t)+x0;
y[i]=r*sin(i*t)+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();
}
\新建文件夹\美丽宝石图案.cpp F:\新建文件夹\F graphics.h: No such file or directory.
F:\新建文件夹\美丽宝石图案.cpp In function `int main()':
9 F:\新建文件夹\美丽宝石图案.cpp `DETECT' undeclared (first use this function)
(Each undeclared identifier is reported only once for each function it appears in.)
10 F:\新建文件夹\美丽宝石图案.cpp `printf' undeclared (first use this function)
11 F:\新建文件夹\美丽宝石图案.cpp `scanf' undeclared (first use this function)
12 F:\新建文件夹\美丽宝石图案.cpp `initgraph' undeclared (first use this function)
13 F:\新建文件夹\美丽宝石图案.cpp `cleardevice' undeclared (first use this function)
14 F:\新建文件夹\美丽宝石图案.cpp `WHITE' undeclared (first use this function)
14 F:\新建文件夹\美丽宝石图案.cpp `setbkcolor' undeclared (first use this function)
15 F:\新建文件夹\美丽宝石图案.cpp `RED' undeclared (first use this function)
15 F:\新建文件夹\美丽宝石图案.cpp `setcolor' undeclared (first use this function)
19 F:\新建文件夹\美丽宝石图案.cpp [Warning] converting to `int' from `double'
20 F:\新建文件夹\美丽宝石图案.cpp [Warning] converting to `int' from `double'
25 F:\新建文件夹\美丽宝石图案.cpp `line' undeclared (first use this function)
27 F:\新建文件夹\美丽宝石图案.cpp `getch' undeclared (first use this function)
28 F:\新建文件夹\美丽宝石图案.cpp `closegraph' undeclared (first use this function)