能力值:
( LV3,RANK:30 )
2 楼
放到数据库里面不是很简单吗?
能力值:
( LV3,RANK:20 )
在线值:
3 楼
看楼主的代码都是从小到大,从大到小的话直接输出~
下面的,输是能输出不过有问题
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
.386
.model flat,stdcall
option casemap:none
include windows.inc
include user32.inc
include kernel32.inc
includelib user32.lib
includelib kernel32.lib
.data
szFin db
'\in.txt'
,0
szOut db
'\out.txt'
,0
.data?
dwNum
dd
?
hFile
dd
?
hFileOut
dd
?
dwFread
dd
?
szRead db 4096 dup (?)
szWrite db 4096 dup (?)
szBuffer db 260 dup (?)
szOutFile db 260 dup (?)
szTemp db 260 dup (?)
.const
.code
start:
invoke GetCurrentDirectory,260,addr szBuffer
invoke lstrcpy,addr szOutFile,addr szBuffer
invoke lstrcat,addr szOutFile,addr szOut
invoke lstrcat,addr szBuffer,addr szFin
invoke CreateFile,addr szBuffer,GENERIC_ALL,FILE_SHARE_WRITE or FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL
.
if
eax==-1
jmp EExit
.endif
mov hFile,eax
invoke ReadFile,hFile,addr szRead,4000,addr dwFread,NULL
lea esi,szRead
add esi,dwFread ;dwFread 实际读取的数
lea edi,szWrite
lea ebx,szTemp
mov ecx,dwFread
mov dwNum,0
cover:
mov al,BYTE PTR [esi]
cmp
al,0ah
jz xx
cmp
al,0dh
jz yy
mov BYTE PTR [ebx],al
inc dwNum
zz:
inc ebx
dec esi
loop cover
invoke CreateFile,addr szOutFile,GENERIC_READ or GENERIC_WRITE,FILE_SHARE_WRITE or FILE_SHARE_READ,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL
.
if
eax==-1
jmp EExit
.endif
mov hFileOut,eax
invoke WriteFile,hFileOut,addr szWrite,dwFread,addr dwFread,NULL
EExit:
invoke CloseHandle,hFile
invoke CloseHandle,hFileOut
invoke ExitProcess,NULL
xx:
push ecx
mov ecx,dwNum
hh:mov al,BYTE PTR [ebx]
mov BYTE PTR [edi],al
dec ebx
inc edi
loop hh
mov BYTE PTR [edi],0dh
inc edi
pushad
invoke RtlZeroMemory,addr szTemp,260
popad
lea ebx,szTemp
pop ecx
mov dwNum,0
jmp zz
yy:
mov BYTE PTR [edi],0ah
inc edi
lea ebx,szTemp
jmp zz
end start