1-99奇数求和

 1 n = 1
 2 count = 0
 3 while n < 100:
 4     if n % 2 == 0:
 5         pass
 6     else:
 7         n = n
 8        # print(n)
 9     n = n+1
10     count = count+n
11 print(count)

猜你喜欢

转载自www.cnblogs.com/llmx002/p/9236506.html