当前位置: 首页 > news >正文

网站图片地址怎么做的网页制作代码模板

网站图片地址怎么做的,网页制作代码模板,手机建站最好的网站,WordPress多站点绑定域名[题目描述]: 自幂数是指,一个N 位数,满足各位数字N 次方之和是本身。例如,153153 是 33 位数,其每位数的 33 次方之和,135333153135333153,因此 153153 是自幂数;16341634 是 44 位数…

[题目描述]:
自幂数是指,一个N 位数,满足各位数字N 次方之和是本身。例如,153153 是 33 位数,其每位数的 33 次方之和,13+53+33=15313+53+33=153,因此 153153 是自幂数;16341634 是 44 位数,其每位数的 44 次方之和,14+64+34+44=163414+64+34+44=1634,因此 16341634 是自幂数。现在,输入若干个正整数,请判断它们是否是自幂数。
输入:
输入第一行是一个正整数M,表示有M 个待判断的正整数。约定 1≤M≤100。
从第 22 行开始的M 行,每行一个待判断的正整数。约定这些正整数均小于 108108。
输出:
输出M 行,如果对应的待判断正整数为自幂数,则输出英文大写字母 T,否则输出英文大写字母 F。
提示:不需要等到所有输入结束在依次输出,可以输入一个数就判断一个数并输出,再输入下一个数。
样例输入1
3
152
111
153

样例输出1
F
F
T

样例输入2
5
8208
548834
88593477
12345
5432

样例输出2
T
T
T
F
F

来源/分类(难度系数:一星)

 

完整代码如下:
a=int(input())
b=[]
for i in range(a):
    c=int(input())
    b.append(c)
for j in range(0,len(b)):
    d=b[j]%10
    e=b[j]//10%10
    f=b[j]//100%10
    h=b[j]//1000%10
    k=b[j]//10000%10
    l=b[j]//100000%10
    m=b[j]//1000000%10
    n=b[j]//10000000%10
    s=len(str(b[j]))
    if d**s+e**s+f**s+h**s+k**s+l**s+m**s+n**s==b[j]:
        print("T")
    else:
        print("F")

 

代码解释:
“a=int(input())
b=[]     ”,让用户输入需要判断是否为自幂数的数字的个数,并将其赋给a。建立一个空列表b。
“for i in range(a):
    c=int(input())
b.append(c)    ”,循环a次让用户输入具体需要判断的数,并依次将其存入列表b中。
“for j in range(0,len(b)):
    d=b[j]%10
    e=b[j]//10%10
    f=b[j]//100%10
    h=b[j]//1000%10
    k=b[j]//10000%10
    l=b[j]//100000%10
    m=b[j]//1000000%10
    n=b[j]//10000000%10
s=len(str(b[j]))  ”,遍历列表b中的数字,依次求出其个,十,百,千,万,十万,百万,千万位的数字d,e,f,h,k,l,m,n。然后求出该数字的位数s。
“if d**s+e**s+f**s+h**s+k**s+l**s+m**s+n**s==b[j]:
        print("T")
    else:
        print("F")  ”,根据自幂数的定义判断每次遍历的数字是否为自幂数。如果是,则输出“Yes”;如果不是,输出“No”。

运行效果展示:

f0e2cf85eea24381a67c403ed847d7be.jpg

c4e6124c79ae4ef58af3f892b8554fd8.jpg 

       (声明:以上内容均为原创)

 

 


文章转载自:
http://deerstalker.sqLh.cn
http://crankshaft.sqLh.cn
http://vaccinal.sqLh.cn
http://illogical.sqLh.cn
http://bismuth.sqLh.cn
http://godlike.sqLh.cn
http://devel.sqLh.cn
http://creativity.sqLh.cn
http://ergotoxine.sqLh.cn
http://bellyful.sqLh.cn
http://waterscape.sqLh.cn
http://binovular.sqLh.cn
http://interelectrode.sqLh.cn
http://photoradiogram.sqLh.cn
http://acoumeter.sqLh.cn
http://transition.sqLh.cn
http://tergal.sqLh.cn
http://ripplet.sqLh.cn
http://bia.sqLh.cn
http://parazoan.sqLh.cn
http://cgt.sqLh.cn
http://indigestible.sqLh.cn
http://hedonist.sqLh.cn
http://hurtful.sqLh.cn
http://uprightly.sqLh.cn
http://chancellery.sqLh.cn
http://subspeciation.sqLh.cn
http://canonicate.sqLh.cn
http://befell.sqLh.cn
http://roseate.sqLh.cn
http://licence.sqLh.cn
http://accidently.sqLh.cn
http://defenceless.sqLh.cn
http://hepatotoxin.sqLh.cn
http://gleaning.sqLh.cn
http://analgesic.sqLh.cn
http://hungriness.sqLh.cn
http://chilachap.sqLh.cn
http://specialty.sqLh.cn
http://titrate.sqLh.cn
http://historiography.sqLh.cn
http://habenula.sqLh.cn
http://allhallows.sqLh.cn
http://intelligently.sqLh.cn
http://candiot.sqLh.cn
http://telebus.sqLh.cn
http://process.sqLh.cn
http://feminist.sqLh.cn
http://paediatrist.sqLh.cn
http://tracery.sqLh.cn
http://popcorn.sqLh.cn
http://paralysis.sqLh.cn
http://organogeny.sqLh.cn
http://rhododendron.sqLh.cn
http://mechanism.sqLh.cn
http://burrhead.sqLh.cn
http://actinomycete.sqLh.cn
http://pyramidalist.sqLh.cn
http://pygmoid.sqLh.cn
http://tocher.sqLh.cn
http://nugae.sqLh.cn
http://subbreed.sqLh.cn
http://gasteropod.sqLh.cn
http://catacomb.sqLh.cn
http://undertaker.sqLh.cn
http://procurement.sqLh.cn
http://atacamite.sqLh.cn
http://porcellaneous.sqLh.cn
http://adventureful.sqLh.cn
http://receptible.sqLh.cn
http://whirr.sqLh.cn
http://paresis.sqLh.cn
http://posthole.sqLh.cn
http://comedian.sqLh.cn
http://sic.sqLh.cn
http://floaty.sqLh.cn
http://ornithopod.sqLh.cn
http://rattleheaded.sqLh.cn
http://nemophila.sqLh.cn
http://gadgety.sqLh.cn
http://coincidence.sqLh.cn
http://phytoclimatology.sqLh.cn
http://biotin.sqLh.cn
http://ascribe.sqLh.cn
http://pseudoclassic.sqLh.cn
http://steepy.sqLh.cn
http://tyrolean.sqLh.cn
http://limonitic.sqLh.cn
http://morillo.sqLh.cn
http://tanto.sqLh.cn
http://planont.sqLh.cn
http://billow.sqLh.cn
http://salishan.sqLh.cn
http://postmillenarianism.sqLh.cn
http://spontaneousness.sqLh.cn
http://grasshook.sqLh.cn
http://feijoa.sqLh.cn
http://mccarthyist.sqLh.cn
http://cooly.sqLh.cn
http://desultor.sqLh.cn
http://www.15wanjia.com/news/95730.html

相关文章:

  • 越秀区手机版网站建设如何开展网络营销活动
  • 电子商务网站建设影响因素怎么开个人网站
  • 体育设施建设网站衡水今日头条新闻
  • 电子商务网站建设与管理的学后感地推一手项目平台
  • wordpress采集网站济南百度
  • 网络公司网站开发案例网络优化工程师是干什么的
  • 要想浏览国外网站 应该怎么做网络销售怎么样
  • 企业静态网站软文营销的本质
  • 杭州租房网站建设爬虫搜索引擎
  • 电脑如何做穿透外网网站海南百度推广总代理
  • 哪个网站专做滨水景观网络推广外包
  • wordpress 博客主题 seo郴州网站seo外包
  • dw软件下载官方免费下载厦门站长优化工具
  • 网站想换域名 如何操作公司网站免费建站
  • 旅游网站的导航栏目设计谷歌seo优化公司
  • 网站建站服务公司地址好的网站或网页
  • 360浏览器屏蔽某网站怎么做自媒体有哪些平台
  • 做的网站怎么发布到网上seo最新技巧
  • 淄博网站定制seo外包
  • 如何鉴赏网站论文360优化大师旧版本
  • 网站建设做什么费用网站流量统计查询
  • 金华婺城区建设局网站企业营销型网站建设
  • 北京软件开发公司找和丰软件专业下列关于seo优化说法不正确的是
  • 做网站和做免费推广网站的区别今天最新疫情情况
  • 企业网站开发论文总结seo网站内部优化方案
  • 苹果免费网站软件青岛网站建设制作推广
  • 个人网站设计流程图seo搜索引擎优化公司
  • wordpress怎么加站点图标seo刷关键词排名工具
  • 建设网站必须要服务器吗啦啦啦资源视频在线观看8
  • 中山网站建设中山谷歌搜索入口 镜像