原理:是临近的数字两两进行比较,按照从小到大或者从大到小的顺序进行交换, function bubbleClick() { var str = "50,1,4,6,9,76,43,22,2,44,7,66"; bubble(str); } function bubble(str) { var a = new Array(); a = str.split(',');//字符串数组, //var a = [50, 1, 4, 6, 9, 76, 43, 22, 2, 44, 7, 66]
(1)从键盘输入一个字符串(串长不大于80). (2)以十进制输出字符串中非字母字符的个数(不是a to z或 A to Z). (3)输出原字符串且令非字母字符闪烁显示. (4)找出字符串中ASCII码值最大的字符,在字符串中用红色显示. (5)字符串的输入和结果的输出都要有必要的提示,且提示独占一行. (6)要使用到子程序. data segment hintinput db "please input a string:$" hintoutput1 db "The nu
data segment s1 db 'Good,better,best,$' s2 db 'Never let it rest,$' s3 db 'Till good is better,$' s4 db 'And better,best.$' s dw offset s1, offset s2, offset s3, offset s4 row db ,,, ends code segment start: mov ax,data mov ds,ax mov bx,offset s mov