影挚
影挚
全部文章
题解
归档
标签
去牛客网
登录
/
注册
影挚的博客
全部文章
/ 题解
(共71篇)
题解 | #判断闰年#
year = int(input()) if year % 4 == 0: if year % 100 == 0: if year % 400 == 0: print('yes') else: print('no') else: print('yes') else: print('no')
Python3
2022-04-19
0
235
题解 | #小乐乐与欧几里得#
m, n = map(int, input().split()) a, b = m, n while(b!=0): temp = a % b a = b b = temp c = m * n // a print(a + c) 标记一下 求最小公倍数的算法: 最小公倍数 = 两个整数的乘积 / ...
Python3
2022-04-19
0
314
题解 | #小乐乐定闹钟#
a, b, c = map(int, input().replace(':', ' ').split()) a = (a + c // 60 % 24) % 23 if a == 0: a = 23 b = (b + c % 60) % 60 print('%02d:%02d' % (a, b))
Python3
2022-04-19
2
654
题解 | #计算三角形的周长和面积#
import math a, b, c = map(eval, input().split()) circumference = a + b + c S = circumference / 2 area = math.sqrt(S * (S - a) * (S - b) * (S - c)) pri...
Python3
2022-04-19
0
243
题解 | #牛牛的空格分隔#
a = [] for i in range(3): num = input() try: if num.split('.')[1]: num = '%.6f' % eval(num) a.append(str(num)) except: a.append(num) print(' '.join(a)...
Python3
2022-04-18
0
294
题解 | #大小写转换#
while True: try: str_use = input() print(str_use.lower()) except: break 题目说的不清楚吧,要一直输入 标记一下,之后再看看
Python3
2022-04-18
2
464
题解 | #按照格式输入并交换输出#
str_use = input().replace('=', ',').split(',') str_use[1], str_use[3] = str_use[3], str_use[1] print('%s=%s,%s=%s' % (str_use[0], str_use[1], str_use[...
Python3
2022-04-18
0
253
题解 | #出生日期输入输出#
birthday = int(input()) year, month, day = birthday // 10000, birthday // 100 % 100, birthday % 100 print('year={}\nmonth={:0>2}\ndate={:0>2}'.f...
Python3
2022-04-18
0
314
题解 | #学生基本信息输入输出#
all_data = input().split(';') b = all_data[1].split(',') scores = list(map(lambda x: round(eval(x) + 0.0001, 2), all_data[1].split(','))) print('The e...
Python3
2022-04-18
2
331
题解 | #成绩输入输出#
scores = input().split() for i in range(len(scores)): if i == len(scores) - 1: print('score%d={}'.format(scores[i]) % (i+1)) else: print('score%d={}'....
Python3
2022-04-18
0
263
首页
上一页
1
2
3
4
5
6
7
8
下一页
末页