#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 个警告
2 回答
守着星空守着你
TA贡献1799条经验 获得超8个赞
1.[Error] G:\程序语言cpp\Debug\圆.cpp:4: error: `main' must return `int'
我学的C++的main()函数都是返回int值得,int main(),你改成这样最后return 0就可以了
2.[Error] G:\程序语言cpp\Debug\圆.cpp:6: error: stray '\163' in program
[Error] G:\程序语言cpp\Debug\圆.cpp:6: error: stray '\187' in program
这个是出现中文字符了,for(x=25,y=25;x<=475,y<=475;x+=20,y+=20)中的分号是中文符号,改成英文的就可以了
3.[Error] G:\程序语言cpp\Debug\圆.cpp:25: error: expected `}' at end of input你程序的最后少了个"}"
- 2 回答
- 0 关注
- 199 浏览
添加回答
举报
0/150
提交
取消