assume cs:code,ds:data,ss:stack
data segmentarr dw 1111h,2222h,3333h,4444h,5555h,6666h,7777h,8888hres db 800 dup(0)
data endsstack segmentdb 100 dup(0)
stack endscode segmentstart:mov ax,datamov ds,axmov ax,stackmov ss,axmov bx,0mov cx,8for:push ds:arr[bx]add bx,2loop formov bx,0mov cx,8for1:pop ds:arr[bx]add bx,2loop for1mov ax,4c00hint 21code ends
end start
comment*
翻转思路
vector<int>arr = {1,2,3,4,10,20,30,40};
stack<int>stk;
for (int i = 0; i < 8; i++)stk.push(arr[i]);
for (int i = 0; i < 8; i++)arr[i] = stk.top(),stk.pop();
*comment
2. 用动态规划求斐波那契数列
assume cs:code,ds:data,ss:stack
data segmentarr dw 1h,1h,100 dup (0)res db 800 dup (0)
data endsstack segmentdb 100 dup(0)
stack endscode segmentstart:mov ax,datamov ds,axmov ax,stackmov ss,axmov bx,4mov cx,10for:mov dx,0add dx,ds:arr[bx-2]add dx,ds:arr[bx-4]mov ds:arr[bx],dxadd bx,2loop formov ax,4c00hint 21code ends
end start
comment*
求斐波那契数列
int arr[100] = {1,1};
for (int i = 2; i < 10; i++)arr[i] = arr[i-1] + arr[i-2];
return arr
*comment
执行会出现以下错误信息 java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ? and loginPwd ? at line 1 at com.mysql.cj.jdbc.exceptions…