从键盘输入1-5中的一个数分别在屏幕上显示1st,2st,3st,4st,5st,其他显示*

来源:百度知道 编辑:UC知道 时间:2024/05/28 19:30:41
用汇编语言编程!

code segment
assume cs:code
start:
mov ah,1
int 21h
cmp al,30h
jbe other
cmp al,36h
jae other
mov dl,al
mov ah,2
int 21h
mov dl,'s'
int 21h
mov dl,'t'
int 21h
jmp tj
other:
mov dl,'*'
mov ah,2
int 21h
tj:
mov ah,1
int 21h
mov ah,4ch
int 21h
code ends
end start

#include<stdio. h>
void main()
{ int a;
scanf("%d",&a);
switch(a)
{
case 1:
case 2:
case 3:
case 4:
case 5:printf("1st,2st,3st,4st,5st\n");break;
default:printf("other!\n");break;
}

; multi-segment executable file template.

data segment
    ; add your data here!
    str  db 10,13,0
    chr  

从键盘输入1-5中的一个数分别在屏幕上显示1st,2st,3st,4st,5st,其他显示* 从键盘输入一个1位十进制数,显示其对应的4位 从键盘输入一个数如果是3则输出 用汇编语言编写程序:从键盘输入一个十进制数,对其开平方后分别将其平方根和余数以十进制数的形式显示 编写一个程序,从键盘输入5个数,求这5个数中最大数和最小数 一个c语言编程问题:求s=1/2-2/3+3/5-5/8+.....相加的项数n从键盘输入 用c语言编写从键盘输入一个数,判断是否在数组a里(1~10的整数) 从键盘输入任意三个整数a,b,c,求三个数中的最大值。 从键盘输入一个正整数,计算该数的各位数字之和并输出,例如输入数是5246,则计算5+2+4+6并输出 编写一个C程序,判断从键盘输入的一个数M是否是素数。