def coordinate_axis(): temps = [-22, 19, 22, -1, -25, 27, 30] forecast(temps, 20, 4) coordinate_axis()

def rect(x, y, w, h): jump(x,y) for i in range(2): forward(w) right(-90) forward(h) right(-90)

def forecast(temps, space, base): x=0 y=0 w=20 for i in range(len(temps)): temp=temps[i] rect(x,y,w,temp*base) x=x+w+space

def char(temps): coordinate_axis() forecast(temps, 20, 4) temps = [-22, 19, 22, -1, -25, 27, 30] char(temps)

3 条评论

  • 请大家帮帮我

    • 计算长方形面积

      a 代表长,b 代表宽,s 代表面积

      面积公式: s = a * b

      输入:先输入 a 的值,再输入 b 的值

      输出:s 的值

      输入:

      2
      3
      

      Copy

      输出:

      6
      

      哪些呢???

    • @ 2023-1-7 11:16:13
      from wonderLang import *
      
      def rect(x,y,w,h):
          jump(x,y)
          for i in range(2):
              forward(w)
              right(-90)
              forward(h)
              right(-90)
      
      def forecast(temps,space,base):
          x=0
          y=0
          w=20
          for i in range(len(temps)):
              temp=temps[i]
              rect(x,y,w,temp*base)
              x=x+w+space
      
      def coordinate_axis():
          forward(300)
          right(-120)
          forward(30)
          jump(300,0)
          right(-120)
          forward(30)
          right(-120)
          jump(0,0)
          right(-90)
          forward(300)
          right(-120)
          forward(30)
          jump(0,300)
          right(-120)
          forward(30)
          right(-120)
          jump(0,0)
          right(90)
      
      def char(temps):
          coordinate_axis()
          forecast(temps, 20, 4)
      
      temps = [-22, 19, 22, -1, -25, 27, 30]
      
      char(temps)
      
    • 1

    信息

    ID
    131
    时间
    1000ms
    内存
    256MiB
    难度
    5
    标签
    递交数
    555
    已通过
    212
    上传者