摘要: 题目: A,B,C,D,E五个人捕鱼,不计其数,然后休息, 早上A第一个醒来,将鱼均分成五份,把多余的一条鱼扔掉,拿走自己的一份, B第二个醒来,也将鱼均分为五份,把多余的一条鱼扔掉,拿走自己的一份。 CDE依次醒来,也按同样的方法拿鱼,问他们合伙至少捕了几条鱼。 结果:3121 阅读全文
posted @ 2018-03-11 22:27 圆柱模板 阅读(1022) 评论(0) 推荐(0)
摘要: 公鸡5元1只,母鸡3元1只,小鸡一元3只,100元买100只鸡,三种鸡各多少只 x+y+z=100 5*x+3*y+z//3=100 z%3==0 穷举法-穷尽所有的可能性找到真正的答案 阅读全文
posted @ 2018-03-11 22:25 圆柱模板 阅读(349) 评论(0) 推荐(0)
摘要: row = int(input('请输入行数: ')) for row in range(1,row): for col in range (1,row+1): print( (col),end='') print() for i in range(row): for _ in range(i + 1): print('*', e... 阅读全文
posted @ 2018-03-11 22:24 圆柱模板 阅读(2272) 评论(0) 推荐(0)
摘要: """ 输入三个数,输出其最大值 Author:罗万财 Date:2017-7-6 """ a=int(input('a=')) b=int(input('b=')) c=int(input('c=')) my_max=a>b and a or b my_max=c>my_max and c or my_max print(my_max) 结果: a=5 b=1 c=78 78 ... 阅读全文
posted @ 2018-03-11 22:23 圆柱模板 阅读(9224) 评论(0) 推荐(0)
摘要: """ 工资计算 Author:罗万财 Date:2017-6-8 """ salary=float(input('请输入工资:')) insurance=float(input('五险一金:')) diff=salary-insurance-3500 if diff<=0: tax=0 deduction=0 elif diff<=1500: tax=0.03... 阅读全文
posted @ 2018-03-11 22:20 圆柱模板 阅读(783) 评论(0) 推荐(0)
摘要: """ 猜数字游戏(电脑给数字人猜) Author:罗万财 Date:2017-6-3 """ from random import randint you_answer=int(input('请输入:')) counter=0 x=1 y=100 is_correct=False while not is_correct: counter+=1 answer=ran... 阅读全文
posted @ 2018-03-11 22:19 圆柱模板 阅读(179) 评论(0) 推荐(0)
摘要: """ 已知三角形的边长求他的面积和周长 Author:罗万财 Date:2017-3-3 """ import math a=float(input('a=')) b=float(input('b=')) c=float(input('c=')) if a+b>c and a+c>b and b+c>a: d=a+b+c e=(a+b+c)/2 f=math... 阅读全文
posted @ 2018-03-11 22:17 圆柱模板 阅读(4663) 评论(0) 推荐(0)
摘要: def main(): num = int(input('Number of rows: ')) yh = [[]] * num for row in range(num): yh[row] = [None] * (row + 1) for col in range(row+1): if col == 0 or... 阅读全文
posted @ 2018-03-11 22:16 圆柱模板 阅读(511) 评论(0) 推荐(0)
摘要: 应用题: 30个人出海去玩,船瓦特了,要弄死15个人,其他人才能活下来,围成一圈,报数1,2,3...,谁报到9就弄死谁,以此类推. 直到剩下15个人为止.其中15个人是基督徒,其他15个不是基督徒,求这些人的站位. 结果: 基基基基非非非非非基基非基基基非基非非基基非非非基非非基基非 阅读全文
posted @ 2018-03-11 22:13 圆柱模板 阅读(319) 评论(0) 推荐(0)
摘要: 结果: 332 阅读全文
posted @ 2018-03-11 22:12 圆柱模板 阅读(867) 评论(0) 推荐(0)