pythonExample100/JCP083.py

18 lines
287 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

'''
【程序83】
题目求0—7所能组成的奇数个数。
1.程序分析:
2.程序源代码:
'''
if __name__ == '__main__':
sum = 4
s = 4
for j in range(2,9):
print sum
if j <= 2:
s *= 7
else:
s *= 8
sum += s
print 'sum = %d' % sum