#include <graphics.h>
#include <conio.h>
void main()
{int x,y;
initgraph(600,600);
for(x=25,y=25;x<=475,y<=475;x+=20,y+=20)
{
setcolor(GREEN);
setfillstyle(YELLOW);
fillellipse(x,y,25,25);
Sleep(500);
cleardevice();
for (int x=475,y=475;x<=25,y<=25;x-=20,y-=20)
{
setcolor(GREEN);
setfillstyle(YELLOW);
fillellipse(x,y,25,25);
Sleep(500);
cleardevice();
}
}
然后一堆错误.
--------------------配置: mingw5 - CUI Debug, 编译器类型: MinGW--------------------
检查文件依赖性...
正在编译 G:\程序语言cpp\Debug\圆.cpp...
[Error] G:\程序语言cpp\Debug\圆.cpp:4: error: `main' must return `int'
[Warning] G:\程序语言cpp\Debug\圆.cpp:5: warning: converting to non-pointer type `int' from NULL
[Error] G:\程序语言cpp\Debug\圆.cpp:6: error: stray '\163' in program
[Error] G:\程序语言cpp\Debug\圆.cpp:6: error: stray '\187' in program
[Error] G:\程序语言cpp\Debug\圆.cpp:6: error: expected `;' before "x"
[Error] G:\程序语言cpp\Debug\圆.cpp:6: error: expected `;' before ')' token
[Warning] G:\程序语言cpp\Debug\圆.cpp:25:2: warning: no newline at end of file
[Error] G:\程序语言cpp\Debug\圆.cpp:25: error: expected `}' at end of input
构建中止 圆: 6 个错误, 2 个警告
守着星空守着你
牧羊人nacy
相关分类