1、负数的和并输出。 108.有一个首地址为string的字符串,剔除string中所有的空格字符。请从字符串最后一个字符开始逐个向前判断、并进行处理。 129.有一个首地址为string的字符串,分别统计string中空格、英文字母、数字和其它字符的个数并输出。 1310.palindrome(回文)是指正读和反读都一样的数或文本。例如:11、121. 12321 等,编写程序,求10到10000之间所有回文数并输出。要求每行输出10个数。1511.编写程序,求出所有满足勾股定理且边长不大于500的直角三角形。.1712.编写一个求n!的子程序,利用它求1 !+2!+引+4!+5!+6!+7!+
2、8!的和并输出。2213.编写一个判断闰年的子程序,利用它求出2010年到2060年之间所有的闰年并输出。 2514.编写一个求解双字型有符号数数组元素的平均值子程序,并验证它的正确 性。262x (x 0)s = 3x (0 = x in elude io32.i nc.codestart:call readsidemp eax,0jl smallemp eax,10jle midjmp largesmall:imul eax,2jmp donemid:imul eax,3large:imul eax,4done:call dispsidexit 0end start2输入一个年份(调用re
3、aduid子程序),判断是否是闰年.datayes_msg byte is leap:13,10,0no_msg byte no leap,13,10,0call readuidmov edx,0mov ecx,4div ecxemp edx,0je firstjmp secondfirst:mov ecx,100jne leapsec ond:mov ecx,400je leapjmp noleapleap:mov eax,offset yes_msgcall dispmsgnoleap:mov eax,offset no_msg3输入三个无符号整数(调用readuid子程序),判断并输出这
4、三个数是否能 构成一个三角形的三条边。若这三个数能构成一个三角形的三条边,输出三 角形的形状:msgdengyao byte dengyao:13,10,0 ;等腰三角形msg_dengbian byte dengbian,13,10,0 ;等边三角形msg_zhijiao byte zhijiao直角三角形msg_xiesanjiao byte xiesanjiaoxing:13J0,0;斜三角形msgwrong byte wrong: 13,10,0 ;无法构成三角形sqr dword 0;在ebx,ecx,edx分别保存三条边的长度call readuid ;读取第一个数和第二个数到eb
5、x、ecxmov ebx,eaxmov ecx,eax cmp ebx,ecx jg great jmp nextgreat:xchg ebx,ecxnext:mov edx,eax cmp ebx,edx jg thirdsmall cmp ecx,edx jg thirdmid jmp order ;如果第三个数最小 thirdsmall:mov eax,edxmov edx,ecxmov ecx,ebxjmp order如果第三个数在最中间 thirdmid:xchg ecx,edx;确保 ebx=3 编程输出Fibonacci numbers的前30项。space byte :0;输出空格fl dword 1 ;fn-lf2 dword 1 ;fn-2输出fl输出f2mov ecx,30 mov eax,fl call disp dec ecx mov eax,f2 call dispagai n:mov eax,fl add eaxzf2 call disp mov ebx,f2 mov fl,ebx mov f2,eax loop again jmp doneeax = fn
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1