汇编语言如何编程16进制1位数相加?
汇编语言如何编程16进制1位数相加?
input A,B if A+B >=10 then if A+B=10 then print "A" if A+B=11 then print "B" if A+B=12 then print "C" if A+B=13 then print "D" if A+B=14 then print "E" if A+B=15 then print "F" else print A+B endif end
input A,B case A of '0'..'9': h1 := ord(A)-ord('0'); 'A'..'F':h2 := ord(A)-ord('A')+1; end; case B of '0'..'9': h1 := ord(A)-ord('0'); 'A'..'F':h2 := ord(A)-ord('A')+1; end; h := h1+h2; case h of '0'..'9': print(chr(0+ord(h)); 'A'..'F': print(chr(ord('A')+ord(h)-1); end;
答:QBasic简单一点详情>>