zoukankan      html  css  js  c++  java
  • 实现1*2+3*4+5*6+7*8...+99*100

    total = 0
    x = 1
    y = 2
    while y <= 100:
        total += x * y
        x += 2
        y += 2
    
    print(total)
  • 相关阅读:
    3-8
    3-7
    3-5
    3-4
    3-3
    3-2
    3-1
    2-11
    2-10
    2-9
  • 原文地址:https://www.cnblogs.com/zhangzihong/p/7092091.html
Copyright © 2011-2022 走看看