2020年3月30日
摘要: def move(n,a,b,c): if n==1: print(a,'-->',c) else : move(n-1,a,c,b) print(a,'-->',c) move(n-1,b,a,c) n=eval(input()) move(n,'A','B','C') 输入: 3 运行结果: 阅读全文
posted @ 2020-03-30 08:40 Noraa 阅读(197) 评论(0) 推荐(0) 编辑
  2020年3月24日
摘要: 一、 turtle绘图体系概述 1、原理:一只turtle(海龟)在窗体正中心开始根据函数指令在一个横轴为x、纵轴为y的坐标系从(0,0)位置开始,在这个平面坐标系中移动,在它爬行的路径上绘制图形。 2、画布:turtle画布空间的最小单位是像素。画布是海龟的绘图窗体,可通过函数设置大小、位置及背景 阅读全文
posted @ 2020-03-24 13:28 Noraa 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 用python计算圆周率并用进度条提示算的进度 一、蒙特卡罗法计算pi #e6.1CalPi.py from random import random from math import sqrt import time DARTS = 10**7 hits = 0.0 a=1 start = tim 阅读全文
posted @ 2020-03-24 13:23 Noraa 阅读(205) 评论(0) 推荐(0) 编辑
  2020年3月15日
摘要: 1、画五角星 import turtle turtle.pensize(5) turtle.pencolor("yellow") turtle.fillcolor("red") turtle.begin_fill() for i in range(5): turtle.forward(200) tu 阅读全文
posted @ 2020-03-15 19:43 Noraa 阅读(286) 评论(0) 推荐(0) 编辑
  2020年3月13日
摘要: 实验1: 答题: #include"sqlist.cpp" void main() { SqList *L; ElemType e; InitList(L); ListInsert(L,1,'a'); ListInsert(L,2,'b'); ListInsert(L,3,'c'); ListIns 阅读全文
posted @ 2020-03-13 11:59 Noraa 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 1、使用turtle库绘制一个红色五角星图形 import turtle turtle.pencolor('black') turtle.fillcolor("red") turtle.begin_fill() for i in range(5): turtle.forward(100) turtl 阅读全文
posted @ 2020-03-13 11:35 Noraa 阅读(1158) 评论(0) 推荐(0) 编辑