发工资咯 (Python代码) 注记:python里有个内建函数divmod,挺适合这道题的,哈哈哈```pythondefcal(n):N1,remainder=divmod(n,100)N2,remainder=divmod(remainder,50)N3,remainder=divmod(remainder, 题解列表 2019年06月18日 1 点赞 1 评论 2160 浏览 评分:9.9
编写题解 1197: 发工资咯 摘要:解题思路:注意事项:参考代码:while True: ls=list(map(int,input().split())) if ls[0]==0: break …… 题解列表 2022年02月19日 0 点赞 0 评论 582 浏览 评分:9.9
贪心+for+if求解 **本题主要用来贪心的思想。试想一下,我们怎么能使所发工资人民币的张数最小,是不是我们要尽可能的让程序猿领到最大面额的那几张,例如有一个程序猿的工资是3元,那么人民币张数最小的配法就是2+1=3,同样的道理,如果是70元,那最有的配法就是50+20=70。 题解列表 2022年09月01日 0 点赞 0 评论 714 浏览 评分:9.9
发工资咯!(python代码,思路清晰) 摘要:解题思路:注意事项: 数据需要横向输入参考代码:b = 0money = 0sum1 = 0sum2 = 0while True: # 输入数据,必须要横向输入 a…… 题解列表 2021年04月08日 0 点赞 1 评论 752 浏览 评分:6.0
Python代码,大道至简 摘要:解题思路:注意事项:参考代码:while True: n = list(map(int,input().split())) if n[0] == 0: exit(0) …… 题解列表 2021年04月08日 0 点赞 0 评论 567 浏览 评分:0.0
divmod(x, y)函数,集商和余数于一体 #a,b=divmod(x,y)divmod()函数会返回两个值,第一个为x//y,第二个返回值为x%yMoneyVariety_lis=[100,50,10,5,2,1]while1:num=list(map(int,input().split()))ifnum[0]==0:#满足条件退出while 题解列表 2021年12月24日 0 点赞 0 评论 992 浏览 评分:0.0
str = replace(old, new)替换所有空格 就这????就这???while1:st=input()NewSt=st.replace('','')print(NewSt) 题解列表 2021年12月24日 0 点赞 0 评论 555 浏览 评分:0.0
发工资咯(python) 摘要:解题思路:注意事项:参考代码:while True: n, *salaries = list(map(int, input().split())) if n == 0: br…… 题解列表 2024年03月10日 0 点赞 0 评论 540 浏览 评分:0.0
小白随便写的,记录一下 ```pythonrmb=[100,50,10,5,2,1]defchange_money(li):new_li=[0foriinrange(len(rmb))]#新列表存储每张人民币张数foriinli[1:]:#对列表里的每一个员工工资遍历index=0whilei!=0:#因为题目说工资均整数且 题解列表 2024年03月26日 0 点赞 0 评论 601 浏览 评分:0.0
1197: 发工资咯 摘要:解题思路:注意事项:参考代码:def coin_change(n): coins = [100, 50, 10, 5, 2, 1] num = [] for coin i…… 题解列表 2024年04月09日 0 点赞 0 评论 700 浏览 评分:0.0