亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

為什么別人機器上能完美運行的程序在我的機器上不行?都是什么錯誤?。?/h1>

#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你程序的最后少了個"}"

查看完整回答
反對 回復 2023-04-26
?
牧羊人nacy

TA貢獻1862條經驗 獲得超7個贊

既然是學習,就必須學會看提示,這些提示都是有意義的,不是無聊的亂碼

查看完整回答
反對 回復 2023-04-26
  • 2 回答
  • 0 關注
  • 276 瀏覽

添加回答

了解更多

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號