Commit 62e5e86a by BellCodeEditor

auto save

parent 59c2d914
a = int(input(''))
b = int(input(''))
c = int(input(''))
print((a+b)*c)
m=int(input('请输入大于2的数:'))
sum = 0
for i in range(2,m+1):
if i%9==1 and i%11==1:
sum+=1
print(sum)
\ No newline at end of file
import turtle as t
t.pencolor('blue')
t.pensize(5)
for i in range(3):
t.forward(150)
t.left(120)
t.done()
\ No newline at end of file
m=int(input(''))
a=m//100
b=m//10%10
c=m%10
print(a+b+c)
\ No newline at end of file
m=int(input(''))
for i in range(100,m+1):
a=i//100
b=i//10%10
c=i%10
d=a**3+b**3+c**3
if d==i:
print(i)
\ No newline at end of file
a=55
b='张三'
s='%s有%s个苹果'%(b,a)
f='{}有{}个苹果'.format(b,a)
c='{1}有{0}个苹果'.format(a,b)
d='{e}有{a}个苹果'.format(e='李四',a=55)
print(s)
print(f)
print(c)
print(d)
\ No newline at end of file
a=int(input('请输入:'))
b=int(input('请输入:'))
print(a+b)
\ No newline at end of file
m = int(input('请输入拉灯次数:'))
if m%2==0:
print(0)
else:
print(1)
n = list(map(int,input('请输入,最高100:').split(',')))
a = max(n)
b = min(n)
n.remove(a)
n.remove(b)
c = sum(n)
print('%.2f'%(c/len(n)))
n = int(input('请输入:'))
sum = 0
for i in range(1,n+1):
for a in range(n+1):
for b in range(n+1):
if b%2==1 and i!=a and a!=b and b!=i :
sum+=1
print(i,a,b)
print(sum)
\ No newline at end of file
a = input('请输入:')
print(len(a))
\ No newline at end of file
n = input('请输入:')
b=n[-1::-2]
for i in b:
print(i)
\ No newline at end of file
n = int(input('请输入:'))
a=n*n
print(a)
\ No newline at end of file
import turtle as t
t.fillcolor('red')
t.begin_fill()
t.circle(110)
t.end_fill()
t.fillcolor('green')
t.begin_fill()
t.circle(90)
t.end_fill()
t.fillcolor('blue')
t.begin_fill()
t.circle(70)
t.end_fill()
t.fillcolor('pink')
t.begin_fill()
t.circle(50)
t.end_fill()
t.done()
import turtle as t
t.setup(800,500)
t.bgcolor('red')
t.penup()
t.goto(-280,20)
t.setheading(36)
t.fillcolor('yellow')
t.begin_fill()
for i in range(5):
t.forward(150)
t.left(144)
t.end_fill()
t.goto(-95,150)
t.fillcolor('yellow')
t.begin_fill()
for i in range(5):
t.forward(70)
t.left(144)
t.end_fill()
t.goto(-50,70)
t.fillcolor('yellow')
t.begin_fill()
for i in range(5):
t.forward(70)
t.left(144)
t.end_fill()
t.goto(-60,-15)
t.fillcolor('yellow')
t.begin_fill()
for i in range(5):
t.forward(70)
t.left(144)
t.end_fill()
t.goto(-120,-80)
t.fillcolor('yellow')
t.begin_fill()
for i in range(5):
t.forward(70)
t.left(144)
t.end_fill()
t.hideturtle()
t.done()
\ No newline at end of file
'''【编程实现】
回文数是指一个像 14641 这样“对称”的数,即:将这个数的各位数字按相
反的顺序重新排列后,所得到的数和原来的数一样。请编程求不同位数数字
的回文数的个数。
用户输入一个正整数 M(2<M<7),M 作为回文数的位数。要求输出 M 位的
回文数共有几个及这些回文数中有几个包含数字 99。
输入描述:输入一个正整数 M
输出描述:第一行输出回文数的个数;第二行输出 M 位的回文数中包含数字
99 的有几个'''
m=int(input(''))
a=10**(m-1)
n=(10**m)-1
sum=0
b=0
for i in range(a,n+1):
i = str(i)
if i==i[::-1]:
sum+=1
if '99' in i:
b+=1
print(b)
a = int(input(''))
h = a//3600
m = (a-h*3600)//60
s = a-h*3600 - m*60
print(h,m,s)
\ No newline at end of file
a=int(input('请输入:'))
list=[]
for i in range(a):
b=int(input('请输入:'))
list.append(b)
list.sort()
print(list,end=' ')
'''【提示信息】
倍数与约数:如果 a 能被 b 整除,a 就叫做 b 的倍数,b 就叫做 a 的约数。约
数和倍数都表示一个整数与另一个整数的关系,不能单独存在。
最大公约数:几个整数中公有的约数,叫做这几个数的公约数;其中最大的
一个,叫做这几个数的最大公约数。
举例:12、16 的公约数有 1、2、4,其中最大的一个是 4,所以 4 是 12 与 16
的最大公约数。
最小公倍数:几个自然数公有的倍数,叫做这几个数的公倍数,其中最小的
一个,叫做这几个数的最小公倍数。
举例:4 的倍数有 4、8、12、16,……,6 的倍数有 6、12、18、24,……,4
和 6 的公倍数有 12、24,……,其中最小的是 12,所以 4 和 6 最小公倍数为
12。
【编程实现】
分别输入两个正整数(1<正整数<201),输出这两个正整数的最大公约数 M 及
最小公倍数 N(注:M 和 N 之间以一个英文逗号隔开)。
输入描述:第 1 行输入第一个正整数
第 2 行输入第二个正整数
输出描述:输出这两个正整数的最大公约数 M 及最小公倍数 N(M 和 N 之间
以一个英文逗号隔开'''
a = int(input(''))
b = int(input(''))
c=a*b
if a>b:
while b!=0:
d=a%b
a=b
b=d
print(a,c//a)
else:
while a!=0:
d=b%a
b=a
a=d
print(b,c//b)
\ No newline at end of file
'''【提示信息】
一个正整数如果任何一个数位小于等于右边相邻的数位,则称为一个数位递
增数。
例如:
1135 是一个数位递增数
1024 不是一个数位递增数
【编程实现】
输入一个正整数 n(10<n<10001),输出 10 到 n (包含 10 和 n)中有多少个数位递
增数。
输入描述:输入一个正整数 n(10<n<10001)
输出描述:输出 10 到 n 中有多少个数位递增数'''
n = int(input(''))
for i in range(10,n+1):
i=str(i)
if '0' not in i:
print(i)
n=int(input())
li=[]
for i in range(n):
if n <= 10:
he = input()
if len(he) <= 100000:
re_1=int(he,16)
re_2=oct(re_1)
li.append(re_2[2:])
for i in li:
print(i)
a=int(input(),16)
print(a)
#a=input()
#print(int(a,16))
a = int(input('请输入:'))
b=0
sum = 0
'''for i in range(a+1):
b=b+i
print(b)'''
while b<=a:
sum+=b
b=b+1
print(sum)
r =int(input('请输入:'))
pi=3.1415926
s=r*r*pi
print('%.7f'%s)
y = int(input('请输入:'))
if (y%4==0 and y%100!=0) or y%400==0:
print('Yes')
else:
print('No')
\ No newline at end of file
'''n = int(input('请输入'))#输入n个整数
list=[]
b=0
for i in range(n):#再输入n个数
number=int(input('请输入'))
list.append(number)
a=int(input('请输入'))'''#判断a是否在列表当中
list=[6,8,9,0,5,3]
for j in list:
'''if list[j]==a:
b=b+1'''
n = input('请输入:')
print(len(n))
\ No newline at end of file
import random
data = 'python'
for i in range(10):
xf=random.randint(1,10)
print(xf)
\ No newline at end of file
a = int(input('文化分:'))
b = int(input('实践分:'))
if a >= 90 and b >= 90:
print('优秀')
elif a >= 90 or b >= 90:
print('良好')
elif a >= 75 and a<90 and b >= 90 and b < 90:
print('合格')
else:
print('不合格')
import turtle as t
t.speed(10)
t.pencolor('red')
t.pensize(2)
t.fillcolor('red')
t.right(55)
t.begin_fill()
t.circle(30,120)
t.left(70)
t.forward(40)
t.left(100)
t.forward(45)
t.end_fill()
'''t.penup()
t.goto(20,25)
t.pendown()
t.setheading(30)
t.forward(150)
for i in range(39):
t.penup()
t.left(180)
t.forward(150)
t.left(-176)
t.pendown()
t.forward(150)'''
t.done()
\ No newline at end of file
x=2
print(x+=3//2+5*2+6%4)
\ No newline at end of file
all=0
gold=1
day=0
while all<=165:
gold+=1
all+=gold
day+=1
if gold>=165:
break
print(day)
list=[]
a=int(input(''))
list.append(a)
b=int(input(''))
list.append(b)
c=int(input(''))
list.append(c)
d=int(input(''))
list.append(d)
e=int(input(''))
list.append(e)
f=int(input(''))
list.append(f)
sum=0
for i in list:
for g in list:
for h in list:
for j in list:
for k in list:
if i!=g and i!=h and i!=j and i!=k and g!=h and g!=j and g!=k and h!=j and h!=k and j!=k:
sum+=1
print(sum)
list1=[]
for i in range(5):
n1=max(list)
list1.append(n1)
list.remove(n1)
list1=[str(i) for i in list1]#将列表所有的元素转化为字符格式
list1=''.join(list1)#将列表中所有的元素拼接在一起
print(list1)
data = 'Python'
for i in data:
print(i,end=' ')
mt=100
a
\ No newline at end of file
x=10
while x:
x-=1
if x%2!=0:
continue
print(x)
\ No newline at end of file
n=0
b=1
sum=0
for i in range(165):
b+=1
n+=b
sum+=1
if b>=165:
break
print(sum)
import turtle as t
t.speed(0)
t.pencolor('red')
t.pensize(2)
t.fillcolor('red')
t.begin_fill()
t.right(30)
t.forward(30)
t.right(90)
t.circle(-30,120)
t.right(90)
t.forward(30)
t.end_fill()
t.setheading(30)
for i in range(40):
t.forward(150)
t.penup()
t.goto(0,0)
t.left(3)
t.pendown()
t.hideturtle()
t.done()
\ No newline at end of file
a={'王丽':'10','2':'3'}
b=a.pop('王丽')
print(b)
import random
for i in range(10):
a=random.randint(1,100)
print(a)
\ No newline at end of file
a = int(input('文化分:'))
a = int(input('文化分:'))
b = int(input('实践分:'))
if a >= 90 and b >= 90:
print('优秀')
elif a >= 90 or b >= 90:
print('良好')
elif a >= 75 and a<90 and b >= 90 and b < 90:
print('合格')
else:
print('不合格')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment