版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/github_39655029/article/details/82932848
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018-10-3 11:10
# @Author : Manu
# @Site :
# @File : group.py
# @Software: PyCharm
count = 0
for i in range(1, 5):
for j in range(1, 5):
for k in range(1, 5):
if i != j and i != k and k != j:
print(i, j, k)
count += 1
print("组成的数共有:%d 个" % count)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018-10-3 12:10
# @Author : Manu
# @Site :
# @File : bonus.py
# @Software: PyCharm
while True:
profit = int(input("Input the profit"))
print("利润是 %d 万元" % profit)
if profit <= 10:
bonus = profit * 0.1
elif profit > 10 and profit < 20:
bonus = 10 * 0.1 + (profit - 10) * 0.075;
elif profit >= 20 and profit < 40:
bonus = 10 * 0.1 + (20 - 10) * 0.075 + 0.05 * (profit - 20)
elif profit >= 40 and profit < 60:
bonus = 10 * 0.1 + (20 - 10) * 0.075 + 0.05 * (40 - 20) + 0.03 * (profit - 40)
elif profit >= 60 and profit < 100:
10 * 0.1 + (20 - 10) * 0.075 + 0.05 * (40 - 20) + 0.03 * (60 - 40) + (profit - 60) * 0.015
else:
bonus = 10 * 0.1 + (20 - 10) * 0.075 + 0.05 * (40 - 20) + 0.03 * (60 - 40) + (100 - 60) * 0.015 + (profit - 100) * 0.01
print("奖金是 %f 万元" %bonus)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018-10-3 12:10
# @Author : Manu
# @Site :
# @File : compSquNum.py
# @Software: PyCharm
res = 168 // 2
for i in range(1, res + 1):
if 168 % i == 0:
j = 168 / i;
if i > j and (i + j) % 2 == 0 and (i - j) % 2 == 0 :
m = (i + j) / 2
n = (i - j) / 2
x = m * m - 268
print('这个数可能是: ', x)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018-10-3 14:10
# @Author : Manu
# @Site :
# @File : day.py
# @Software: PyCharm
list1 = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
list2 = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
while True:
year = int(input('输入年份'))
month = int(input('输入月份'))
day = int(input('输入日期'))
sum = 0
if year % 400 == 0 or (year % 4 == 0 and year % 100 != 0):
for i in range(month - 1):
sum += list2[i]
sum += day
else:
for i in range(month - 1):
sum += list1[i]
sum += day
print('这是第 %d 天' %sum)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018-10-3 15:10
# @Author : Manu
# @Site :
# @File : sortNum.py
# @Software: PyCharm
while True:
print('Input x, y, z:')
arr = []
for i in range(3):
tmp = int(input())
arr.append(tmp)
arr.sort()
print('三个数从小到大排序: ', arr)