captain_fto
captain_fto
全部文章
分类
题解(54)
归档
标签
去牛客网
登录
/
注册
captain_fto的博客
全部文章
(共40篇)
题解 | #计算体重指数#
数值计算 weight,height=input().split(" ") bmi=int(weight)/((int(height)/100)**2) print("{:.2f}".format(bmi))
Python3
2021-12-19
1
326
题解 | #总成绩和平均分计算#
数值计算 score1,score2,score3=input().split(" ") total_score=float(score1)+float(score2)+float(score3) avg_score=total_score/3 print("{:.2f} {:.2f}".forma...
Python3
2021-12-18
1
496
题解 | #时间转换#
数值计算 time=input() hour=int(time)//3600 minute=int(time)//60-hour*60 second=int(time)%60 print("{} {} {}".format(hour,minute,second))
Python3
2021-12-18
0
320
题解 | #按照格式输入并交换输出#
两次split获取ab值,换位输出 line=input() list=line.split(",") a=list[0].split("=")[1] b=list[1].split("=")[1] print("a={},b={}".format(b,a))
Python3
2021-12-18
1
344
题解 | #出生日期输入输出#
字符串截取 birth=input() print("year={}\nmonth={:02d}\ndate={:02d}".format(birth[:4],int(birth[4:6]),int(birth[-2:])))
Python3
2021-12-18
0
381
题解 | #ASCII码#
chr(int())取ASCII转换字符 line="73,32,99,97,110,32,100,111,32,105,116,33" for i in line.split(","): print(chr(int(i)),end="")
Python3
2021-12-18
0
296
题解 | #字符金字塔#
固定行数遍历输出字符 def tri_pyramid(char): for i in range(1,6): print(" "*(5-i),end="") print((char+" ")*i,end="") print() char=inp...
Python3
2021-12-18
0
363
题解 | #学生基本信息输入输出#
re.split拆分输入字符,round取四舍五入 import re line=input() list=re.split("[;,]",line) score1=round(float(list[1])+0.0001,2) score2=round(float(list[2])+0.0001,2...
Python3
2021-12-18
1
463
题解 | #获取当前薪水第二多的员工的emp_no以及其对应的薪水salary#
双重select聚合函数取max select a.emp_no,b.salary,a.last_name,a.first_name from employees a,salaries b where a.emp_no=b.emp_no and b.salary=( select max(...
Mysql
2021-12-18
0
336
题解 | #21年8月份练题总数#
device_id去重,模糊匹配日期,2个字段聚合count select count(distinct device_id去重,模糊匹配日期,2个字段聚合count) as did_cnt,count(question_id) as question_cnt from question_pract...
Mysql
2021-12-18
0
345
首页
上一页
1
2
3
4
下一页
末页