zheng = 0
fu = 0
sum = 0
for i in range(200):
a = int(input("请输入数字:"))
if a != 0:
if a >0:
zheng += 1
else:
fu += 1
else:
break
sum += a
ping = sum / (zheng + fu)
print("您输入的正数有%d个,负数有%d个,平均值是%.3f"%(zheng,fu,ping))
money = 10000
four = 0
for i in range(13):
money = money * 0.05 + money
if i == 9:
print("十年后的学费是:%d"%money)
if i >= 9:
four += money
print("十年后大学四年的总学费为:%d"%four)
count = 0
for i in range(100,1000):
if i % 5 == 0 and i % 6 == 0:
print(i,end = " ")
count += 1
if count % 10 == 0:
print()
n = 1
while n ** 2 < 12000:
n += 1
print(n)
n = 1
while n ** 3 < 12000:
n += 1
print(n-1)
a = 0
for i in range(1,5001):
a += 1 / i
print(a)
a = 0
for i in range(5000,0,-1):
a += 1 / i
print(a)
sum = 0
for i in range(1,97,2):
j = i + 2
sum += i / j
print("数列的和是:%f"%sum)
a = 0
i = int(input())
for j in range(1,i):
a += 4 * ((-1) ** (j + 1) / (2 * j - 1))
print(a)
count = 0
for i in range(1,8,2):
for j in range(2,8):
if i != j:
count += 1
print(i,j,end = ",")
print("组合数有%d个数"%count)
import requests
response = requests.get('http://news.baidu.com')
response.encoding = 'utf8'
HTML = response.text
for i in HTML.split('\n'):
if '<a' in i and 'http' in i:
splits = i.split('"')
for s in splits:
if 'http' in s and "background-image" not in s:
print(s)