编程怎么做四个正方形

发布网友 发布时间:2022-04-19 14:54

我来回答

1个回答

热心网友 时间:2023-09-03 20:36

摘要用python 画四个方形import turtle (#引入数据库)turtle.width(1) (#确定线条宽度)turtle.color(“red”)(#确定颜色)turtle.goto(0,0) (#从坐标原点起)turtle.goto(0,100)turtle.goto(100,100)turtle.goto(100,0)turtle.goto(0,0) (#回到方形起点)turtle.penup() (#将整个方形图画下)turtle.goto(-100,0)turtle.pendown() (#确定新一次落笔点)turtle.goto(-100,0)turtle.goto(-100,100)turtle.goto(-200,100)turtle.goto(-200,0)turtle.goto(-100,0) (#回到第二个方形图起点)turtle.penup()turtle.goto(-100,-50)turtle.pendown() (#确定新一次落笔点)turtle.goto(-100,-50)turtle.goto(-200,-50)turtle.goto(-200,-150)turtle.goto(-100,-150)turtle.goto(-100,-50) (#再次回到落笔点)turtle.penup()turtle.goto(0,-50)turtle.pendown() (#确定新一次落笔点)turtle.goto(0,-50)turtle.goto(0,-150)turtle.goto(100,-150)turtle.goto(100,-50) (#再次回到落笔点)turtle.goto(0,-50)turtle.done() (#使四个方形图界面停留在页面内)咨询记录 · 回答于2021-09-28编程怎么做四个正方形用python 画四个方形import turtle (#引入数据库)turtle.width(1) (#确定线条宽度)turtle.color(“red”)(#确定颜色)turtle.goto(0,0) (#从坐标原点起)turtle.goto(0,100)turtle.goto(100,100)turtle.goto(100,0)turtle.goto(0,0) (#回到方形起点)turtle.penup() (#将整个方形图画下)turtle.goto(-100,0)turtle.pendown() (#确定新一次落笔点)turtle.goto(-100,0)turtle.goto(-100,100)turtle.goto(-200,100)turtle.goto(-200,0)turtle.goto(-100,0) (#回到第二个方形图起点)turtle.penup()turtle.goto(-100,-50)turtle.pendown() (#确定新一次落笔点)turtle.goto(-100,-50)turtle.goto(-200,-50)turtle.goto(-200,-150)turtle.goto(-100,-150)turtle.goto(-100,-50) (#再次回到落笔点)turtle.penup()turtle.goto(0,-50)turtle.pendown() (#确定新一次落笔点)turtle.goto(0,-50)turtle.goto(0,-150)turtle.goto(100,-150)turtle.goto(100,-50) (#再次回到落笔点)turtle.goto(0,-50)turtle.done() (#使四个方形图界面停留在页面内)用python 画四个方形import turtle (#引入数据库)turtle.width(1) (#确定线条宽度)turtle.color(“red”)(#确定颜色)turtle.goto(0,0) (#从坐标原点起)turtle.goto(0,100)turtle.goto(100,100)turtle.goto(100,0)turtle.goto(0,0) (#回到方形起点)turtle.penup() (#将整个方形图画下)turtle.goto(-100,0)turtle.pendown() (#确定新一次落笔点)turtle.goto(-100,0)turtle.goto(-100,100)turtle.goto(-200,100)turtle.goto(-200,0)turtle.goto(-100,0) (#回到第二个方形图起点)turtle.penup()turtle.goto(-100,-50)turtle.pendown() (#确定新一次落笔点)turtle.goto(-100,-50)turtle.goto(-200,-50)turtle.goto(-200,-150)turtle.goto(-100,-150)turtle.goto(-100,-50) (#再次回到落笔点)turtle.penup()turtle.goto(0,-50)turtle.pendown() (#确定新一次落笔点)turtle.goto(0,-50)turtle.goto(0,-150)turtle.goto(100,-150)turtle.goto(100,-50) (#再次回到落笔点)turtle.goto(0,-50)turtle.done() (#使四个方形图界面停留在页面内)C语言做四个正方形代码:代码:1234567891011121314151617181920212223 #include intmain(){ inti,j,n; scanf("%d",&n); for(i=0;i for(j=0;j if(i==0||i==n-1||j==0||j==n-1) printf("*"); else printf(" "); } printf("\n"); } return0; }/*输出:5****** ** ** *******/是用慧编程哦我先试试吧嗯嗯希望我的回答对你有帮助不行,看不懂,你用慧编程的那个软件来回复我,我要连着的四个正方形稍等1.打开scratch2.0,进入其主界面;2.点事件,将当绿旗被点击时拉到右边的脚本编辑区;3.点画笔,将清空和落笔命令拉到右边的脚本编辑区;4.点运动模块,将面向90度的方向和移动10步拉到右边脚本编辑区,并将10改为100;5.继续拉面向180度的方向和移动100步到下面,画好正方形的另一条边;6. 用同样的方法画好剩下的两条边;7.重复上面操作四次,点击绿色旗运行程序就好了不行怎么办?有图片吗?
声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。
E-MAIL:11247931@qq.com