`````` DATA SEGMENT
NUMBER DB 100,?,100 DUP(?)               ;开辟空白空间
TAB DB 0DH,0AH,'\$'                     ;空格回车
LIST1 DB 'INPUT NUMBERS\$'               ;输入数字
LIST2 DB 'INPUT NUMBERS\$'
DATA ENDS

CODE SEGMENT
ASSUME DS:DATA , CS:CODE
START:
MOV AX,DATA
MOV DS,AX
LEA DX,LIST1                         ;将文字显示到屏幕上
MOV AH,09H                         ;09H功能 显示字符
INT 21H                             ;DOS调用
LEA DX,TAB                            ;空格回车
MOV AH,09H                          ;显示回车空格在屏幕上
INT 21H

INPUT:
LEA BP,NUMBER
XOR BX,BX
MOV AH,01H
INT 21H
SUB AL,30H
MOV AH,00H
MOV BL,10H
MUL BL                      ;BL和AL相乘放在AX里
MOV CL,AL
MOV AH,01H
INT 21H
SUB AL,30H
MOV AH,00H
MOV DS:[BP],AL;存入NUMBER中
CMP AL,24H;判断是否与￥一样
JZ LP0
INC BP
INC BL
JMP INPUT

LP0:
LEA SI,NUMBER
INC SI                                 ;SI-1
MOV CL,[SI]                            ;输入个数->CL
DEC CL
INC SI
MOV BX,SI                              ;外循环初始化SI=BX,CH=CL
MOV CH,CL
MOV AL,[BX]

LP1:
INC BX
CMP [BX],AL                             ; [BX]-AL是否有近位 即CF=1
JNC LP2
XCHG AL,[BX]

LP2:
DEC CH
JNZ LP1                                  ;不为零跳转
CMP CH,'0'
JE LP3

LP3:
MOV [SI],AL
INC SI
DEC CL
JNZ LP0
CMP CL,'0'
JE LP4

LP4:
MOV AL,'\$'                                  ;代表‘ONPUT NUMBER’字符串
MOV [SI+1],AL
LEA DX,TAB
MOV AH,09H
INT 21H

LEA DX,LIST2
MOV AH,09H
INT 21H
LEA DX,TAB
MOV AH,09H
INT 21H

MOV DX,OFFSET NUMBER                          ;将NUMBER的偏移地址给DX
INC DX
INC DX
MOV AH,09H
INT 21H
MOV AH,4CH
INT 21H

CODE ENDS
END START

``````
0

1个回答

1

Windows 32位汇编语言课程设计，关于冒泡法排序。

public class Hiirnrn public static void main(String args[])rnrnint []a2;rnint j,s;rnrnfor(int i=0;i<=9;i++)rn a2[i]=i;rnfor(i=0;i<9;i++)rn for(j=i+1;j<=9;j++)rn if(a[i]

class Foo rn int i = 0;rnrnrnpublic class Bar extends Foorn int i = 1;rn public static void main(String[] args) rn Foo foo = new Bar();rn System.out.println(foo.i);rn rn

12,54,32,10,85rnrn将上面几个数冒泡法从大到小输出.(不是冒泡法也可)rn在combobox里显示.

#includern#includern#includernrnvoid Encry()rnrn char key[100];rn char ch, temp;rn int L, i = 0, j = 0;rn if (getchar() == '\n')rn temp = ' ';rn printf("请输入密钥:");rn gets_s(key,100);rn L = strlen(key);rnrn printf("请输入明文:");rnrn while ((ch = getchar()) != '\n')rn rn if (ch = ' ')rn rn i++;rn continue;rn rn if (ch >= 'a'&&ch <= 'z')rn rn printf("%c", (ch + key[j%L] - 'a' - 'a') % 26 + 'A');rn j++;rn rn if (ch >= 'A'&&ch <= 'Z')rn rn printf("%c", (ch + key[j%L] - 'a' - 'A') % 26 + 'A');rn j++;rn rn if (j%L == 0)rn printf(" ");rn i++;rn rn putchar(ch);rnrnrnvoid Decry()rnrn char key[100];rn char ch, temp;rn int L, i = 0, j = 0;rn if (getchar() == '\n')rn temp = ' ';rn printf("请输入密钥:");rn gets_s(key,100);rn L = strlen(key);rnrn printf("请输入密文:");rnrn while ((ch = getchar())!= '\n')rn rn if (ch == ' ')rn rn i++;rn continue;rn rn if (ch >= 'A'&&ch <= 'Z')rn rn printf("%c", (ch - key[j%L] - 'A' + 'a' + 26) % 26 + 'a');rn j++;rn rn if (j%L == 0)rn printf("");rn i++;rn rn putchar(ch);rnrnrnint Exit()rnrn exit(0);rnrnrnint main()rnrn char ch;rn for (;;)rn rn printf("请输入操作 e:加密 d:解密 q:退出 ");rn ch = getchar();rn if (ch == 'e' || ch == 'E')rn Encry();rn else if (ch == 'd' || ch == 'D')rn Decry();rn else if (ch == 'q' || ch == 'Q')rn Exit();rn elsern rn printf("输入命令错误");rn putchar(getchar());rn continue;rn rn rn return 0;rn

1. 冒泡法排序原理 假设有N个数，要求按从小到大顺序排列 a. 进行N-1次循环 b. 在每一次循环中 假设有n个数，首先比较第1个和第2个数，将小数放前，大数放后。然后比较第2个数和第3个数，将小数放前，大数放后，如此继续，直至比较最后两个数，将小数放前，大数放后，（这时一共比较了n-1次） 2. 冒泡法排序的应用 当待排序的元素规模小：用冒泡排序。...

package Sort; import java.util.Random; public class BubbleSort_Solution { /* * 简单交换排序 不是标准的冒泡排序 */ public static void BubbleSort0(int[] a) { int i, j; for (i = 0; i for (j = i +

![这是在B站找的Python教学视频[](https://img-blog.csdn.net/2018090720480386?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0wxNTI2NDQ5Njky/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70)...
64win7系统下数据库连接不了，求大神指教