爱问知识人 爱问教育 医院库

汇编语言如何编程16进制1位数相加?

首页

汇编语言如何编程16进制1位数相加?

汇编语言如何编程16进制1位数相加?

提交回答
好评回答
  • 2018-03-27 12:26:25
    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

    s***

    2018-03-27 12:26:25

其他答案

    2018-03-27 07:26:25
  • 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;
    

    带***

    2018-03-27 07:26:25

类似问题

换一换
  • 汇编语言 相关知识

  • 电脑网络技术
  • 电脑网络

相关推荐

正在加载...

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):