回覆列表
-
1 # ditdh42550
-
2 # 使用者9866520236700
program addasm;
var a,b,c:longint;
begin
readln(a,b);
asm
pusha;
mov eax,a
mov ebx,b
add eax,ebx
mov c,eax
popa;
end;
writeln (a," + ",b," = ",c);
end.
大概這樣就可以了
1.思路:用一個字串陣列儲存輸入的資料,並分別輸出。程式:Var a:array[1..3]of string; i:integer;Begin For i:=1 to 3 do Readln(a[i]); For i:=1 to 3 do Write(a[i][i]); End.2.思路:讀入資料,存入字串變數a中,校驗a的值是否符合要求,然後再將a的ascii碼求出,輸出相鄰的五個。程式:Var a:char; i,j:integer;Begin Readln(a); i:=ord(a); {求出a的ascii碼值} If ((i>66)and(i98)and(i