n=int(input("请输入要查找的自幂数位数:"))
count=total=0
for i in range(1*10**(n-1),1*10**n):
a=i
while a>0:
total+=
a=a//10
if i==total:
count+=1
print(i)
print(str(n)+"位自幂数一共有"++"个")
图 a
图 b
请回答下列问题:
f=open("dc.txt",encoding="utf-8")
line=f.readline()
pro,pub=0,0
# 读取第一行,保存在字符串 line 中
while line: # 当 line 非空
x=
t=int(line[3:])
if x=="A":
pro+=t
line=f.readline() # 继续读取一行
score=int(pro/5*0.6+pub/5*0.4)
grade=
print("推荐度为:","★"*grade)
number=int(input("请输入一个四位数:"))
a = number//1000
b =
c = number % 100 // 10
d = number % 10
if:
print(number,"是四叶玫瑰数")
else:
print(number,"不是四叶玫瑰数")
⒈能被4整除,但不能被100整除;
⒉能被400整除;
mon=[31, 28, 31, 30, 31, 30,31,31, 30, 31,30,31] #mon 中存储1-12每个月的天数
s=input("请输入年月日: ")
year=int(s[:4])
month=int (s[5:7])
sum=0
for i in range ( ):
sum+=mon[i]
sum+=day
if :
isleap=True
else:
isleap=False
if
sum+=1
print(“这一天是当年的第”+str (sum) +“天”)’
public class Exdo
{
public static void main(String args[])
int i=1, sum=0;
do
If((%3)==0); sum +=i;
i++;
}
while(i<10);
System.out printna(* sum="+sum)"