t string "Nov" (4157A0h)
push offset string "%s" (415820h)
lea eax,[ebp-14h]
push eax
call dword ptr [__imp__sprintf (4182C8h)]
add esp,0Ch
cmp esi,esp
call @ILT+310(__RTC_CheckEsp) (41113Bh)
mov esi,esp
push offset string "Nov\0" (4158B4h)
push offset string "%s" (415820h)
lea eax,[ebp-10h]
push eax
call dword ptr [__imp__sprintf (4182C8h)]
add esp,0Ch
cmp esi,esp
call @ILT+310(__RTC_CheckEsp) (41113Bh)
mov esi,esp
push offset string "Dec\0" (415874h)
push offset string "%s" (415820h)
lea eax,[ebp-0Ch]
push eax
call dword ptr [__imp__sprintf (4182C8h)]
add esp,0Ch
cmp esi,esp
call @ILT+310(__RTC_CheckEsp) (41113Bh)
mov esi,esp
call dword ptr [__imp__getchar (4182BCh)]
cmp esi,esp
call @ILT+310(__RTC_CheckEsp) (41113Bh)
sub eax,30h
mov dword ptr [ebp-44h],eax
mov esi,esp
call dword ptr [__imp__getchar (4182BCh)]
cmp esi,esp
call @ILT+310(__RTC_CheckEsp) (41113Bh)
sub eax,30h
mov dword ptr [ebp-50h],eax
mov eax,dword ptr [ebp-44h]
imul eax,eax,0Ah
add eax,dword ptr [ebp-50h]
mov dword ptr [ebp-44h],eax
cmp dword ptr [ebp-44h],0Ch
jg main+1FEh (4137BEh)
mov eax,dword ptr [ebp-44h]
lea ecx,[ebp+eax*4-3Ch]
mov esi,esp
push ecx
call dword ptr [__imp__printf (4182C4h)]
add esp,4
cmp esi,esp
call @ILT+310(__RTC_CheckEsp) (41113Bh)
xor eax,eax
push edx
mov ecx,ebp
push eax
lea edx,[ (4137F0h)]
call @ILT+130(@_RTC_CheckStackVars@8) (411087h)
pop eax
pop edx
pop edi
pop esi
pop ebx
mov ecx,dword ptr [ebp-4]
xor ecx,ebp
call @ILT+25(@__security_check_買粉絲okie@4) (41101Eh)
add esp,114h
cmp ebp,esp
call @ILT+310(__RTC_CheckEsp) (41113Bh)
mov esp,ebp
pop ebp
ret
nop
DATAS SEGMENT
MONTH DB 'JanFebMarAprMayJunJulAugSepOctNovDec'
MESS DB ' INPUT THE MONTH:',0DH,0AH,'$'
NUM DB 3 ;按照標準應該是2 ,但是我寫2 就是不行,可能是我軟件的問題
DB ?
DB 2 DUP(0,?)
DATAS ENDS
CODES SEGMENT
ASSUME CS:CODES,DS:DATAS
START: MOV AX,DATAS
MOV DS,AX
LEA DX,MESS
MOV AH,9
INT 21H
LEA DX,NUM
MOV AH,0AH
INT 21H
MOV AX,0
ADD AL,NUM+2
AND AL,0FH
MOV CL,10
MUL CL
MOV DX,AX
MOV AX,0
MOV AL,NUM+3
AND AL,0FH
ADD AX,DX
SUB AX,1
MOV CL,0003H
MUL CL
MOV BX,AX
MOV CL,3
SHOW: MOV DL,MONTH[BX]
INC BX
MOV AH,2
INT 21H
LOOP SHOW
JMP START
MOV AX,4C00H
INT 21H
CODES ENDS
END START
已經調試過了 沒問題 但是一定要輸入兩位數 比如一月要輸入01
#include <iostream>
using namespace std;
int main()
{
int month;
string strmon;
買粉絲ut<<"輸入一個月份數(1~12):"<<endl;
cin>>month;
switch(month)
{
case 1:strmon="January";break;
case 2:strmon="February";break;
case 3:strmon="March";break;
case 4:strmon="April";break;
case 5:strmon="May";break;
case 6:strmon="June";break;
case 7:strmon="July";break;
case 8:strmon="August";break;
case 9:strmon="September";break;
case 10:strmon="October";break;
case 11:strmon="November";break;
case 12:strmon="December";break;
default:strmon="Error";
}
買粉絲ut<<strmon<<endl;
getchar();
return 0;
}