发布网友 发布时间:2022-04-24 07:21
共2个回答
热心网友 时间:2022-04-18 06:06
sum=0
for i in range(30,300):
if i%3==0:
sum+=i
print(sum)
def maxabc(a,b,c):
if a>b:
m=a
else:
m=b
if m<c:
m=c
return m
a,b,c=map(int,input().split())
print(maxabc(a,b,c))
热心网友 时间:2022-04-18 07:24
#!/usr/bin/python3
# -*- coding:utf-8 -*-
# @FileName :20200930_03.py
# @Time :2020/9/30 16:50
# @Author :Storm_ke
"""
"""
# import
def mymax(a, b, c):
t1 = max(a, b)
t2 = max(t1, c)
return t2
if __name__ == "__main__":
try:
x, y, z = map(eval, input("请输入3个数字,用英文逗号隔开:\n").split(","))
print("输入的{0},{1},{2}中最大值是{3}".format(x, y, z, mymax(x, y, z)))
except (ValueError, TypeError):
print("请输入数字。")
alist = []
for i in range(30, 301):
if divmod(i, 3)[1] == 0:
alist.append(i)
else:
print("能被3整除的数有:{}".format(alist))
print("这些数的和是:{}".format(sum(alist)))