附件1:学号:0121210680529课程设计(基础强化训练)题目SmithNumbers学院计算机科学与技术专业软件工程班级Zy1202姓名胡小意指导教师段鹏飞2014年7月11日课程设计任务书学生姓名:胡小意专业班级:软件zy1202指导教师:段鹏飞工作单位:计算机学院题目:SmithNumbers初始条件:输入:Theinputfileconsistsofasequenceofpositiveintegers,oneintegerperline.Eachintegerwillhaveatmost8digits.Theinputisterminatedbyalinecontainingthenumber0.输出:Foreverynumbern>0intheinput,youaretocomputethesmallestSmithnumberwhichislargerthann,andprintitonalinebyitself.Youcanassumethatsuchanumberexists.要求完成的主要任务:(包括课程设计工作量及其技术要求,以及说明书撰写等具体要求)1、完成算法分析2、给出对应的程序流程图3、给出能正确实现的程序源码5、给出试算截屏图6、课程设计工作的分析与总结7、给出不少于5篇参考文献。时间安排:2014-7-7到2014-7-11指导教师签名:年月日系主任(或责任教师)签名:年月日目录1注册资料.....................................................................................................................42选题描述.....................................................................................................................43算法分析.....................................................................................................................53.1构造逐位相加之和函数...................................................................................53.2求史密斯数.......................................................................................................54程序流程图.................................................................................................................65程序源码.....................................................................................................................86试算截屏图.................................................................................................................97分析与总结.................................................................................................................98参考文献.....................................................................................................................921注册资料用户名:huxiaoyi密码:123456789选题题号:11422选题描述DescriptionWhileskimminghisphonedirectoryin1982,AlbertWilansky,amathematicianofLehighUniversity,noticedthatthetelephonenumberofhisbrother-in-lawH.Smithhadthefollowingpeculiarproperty:Thesumofthedigitsofthatnumberwasequaltothesumofthedigitsoftheprimefactorsofthatnumber.Gotit?Smith'stelephonenumberwas493-7775.Thisnumbercanbewrittenastheproductofitsprimefactorsinthefollowingway:4937775=3*5*5*65837Thesumofalldigitsofthetelephonenumberis4+9+3+7+7+7+5=42,andthesumofthedigitsofitsprimefactorsisequally3+5+5+6+5+8+3+7=42.Wilanskywassoamazedbyhisdiscoverythathenamedthiskindofnumbersafterhisbrother-in-law:Smithnumbers.Asthisobservationisalsotrueforeveryprimenumber,Wilanskydecidedlaterthata(simpleandunsophisticated)primenumberisnotworthbeingaSmithnumber,soheexcludedthemfromthedefinition.WilanskypublishedanarticleaboutSmithnumbersintheTwoYearCollegeMathematicsJournalandwasabletopresentawholecollectionofdifferentSmithnumbers:Forexample,9985isaSmithnumberandsois6036.However,WilanskywasnotabletofindaSmithnumberthatwaslargerthanthetelephonenumberofhisbrother-in-law.ItisyourtasktofindSmithnumbersthatarelargerthan4937775!InputTheinputfileconsistsofasequenceofpositiveinte...