1.free pascal对txtå å¯
free pascal对txtå å¯
注æï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼è¯·é纳ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼
é¦å ï¼æ³¨æï¼è¦å å¯ï¼å¦åå°±ä¼è¢«äººç´æ¥æå¼
å å¯ä»£ç ï¼
var s:string; a,加密加密8哥源码d,p:longint;
ss:array[1..] of string;
begin
readln(a); //aä»ä¹æ°é½è¡ï¼ä½æ¯ä½ 记好äºå®ï¼è§£å¯æ¶ç¨
assign(input,'a.txt');
reset(input);
repeat //æ¯ä¸è¡é½è¦å å¯
readln(s);
for d:=1 to length(s) do s[d]:=chr(ord(s[d])+a);
p:=p+1;
ss[p]:=s;
until s='';
assign(output,'a.txt'); //å¨åæ¥çå°æ¹è¾åº
rewrite(output);
for p:=1 to p do writeln(ss[p]);
close(output);
end.
解å¯ä»£ç ï¼
const mi='aaaaaa'; //è¿éå设å¯ç 为aaaaaaï¼éè¦çè¯èªå·±æ¹
var
a,q,p:longint;
s:string;
b:boolean;
ss:array[1..] of string;
begin
b:=true;
while b do
begin
write('请è¾å ¥å¯ç ï¼');
readln(s);
if s=mi then b:=false else writeln('å¯ç é误ï¼');
end;
write('请è¾å ¥ä¹å解å¯ç代ç ï¼');
readln(a); //è¿æ¶åå°±éè¦è¾å ¥ä»¥åçaäº
assign(input,'a.txt');
reset(input);
repeat //æ¯ä¸è¡é½è¦è§£å¯
readln(s);
for q:=1 to length(s) do s[q]:=chr(ord(s[q])-a);
p:=p+1;
ss[p]:=s;
until s='';
assign(output,'a.txt');
rewrite(output);
for p:=1 to p do writeln(ss[p]);
close(output);
write('æå°å®æ¯ï¼æå车é®ç»æâ¦â¦');
readln;
end.
请å çå®æºä»£ç ååè¿è¡ï¼ï¼ï¼