主题:[原创]我编的一个计算器,现在公开原代码,请评价,或研究。
Program Calculator_1_0;
var n,m:array[1..200]of real; s:real; s2:real; i:longint; fix,iv,er,we,ex,io,ye,se:real; fix2:char;
begin
writeln('China Teenager Calculator 1.00':50);
writeln;
writeln('Author E-mail:123bd123@163.com 370114274@QQ.com Auther QQ:370114274':72);
writeln;
repeat
iv:=1;
write('Number 1:'); readln(n[1]);
repeat
ex:=1;
write('Method:1.+ 2.- 3.* 4./ Fix:'); read(fix);
if fix>4 then begin writeln; writeln('No Fix,Errer ID:12038'); writeln; ex:=0; end else begin
write('Number 2:'); readln(er);
if fix=1
Then s:=n[1]+m[1]
Else if fix=2
Then s:=n[1]-m[1]
Else if fix=3
Then s:=n[1]*m[1]
Else if fix=4
Then s2:=n[1]/er
end;
until ex=1;
write('Result:',s:0:2);
writeln;
repeat
we:=1;
write('Is There anything Else? Fix:1.ExiT 2.Resume ');read(ye);
if ye=1 then begin io:=1; iv:=1; end
else if ye=2 then begin io:=0; iv:=0;for i:=1 to 80 do
write('-'); end
else begin
writeln;
writeln('No Fix Error ID:12075'); we:=0; iv:=0; end;
writeln;
until we=1;
until iv=1;
end.
用TP编译、运行成功,FP没试过。
var n,m:array[1..200]of real; s:real; s2:real; i:longint; fix,iv,er,we,ex,io,ye,se:real; fix2:char;
begin
writeln('China Teenager Calculator 1.00':50);
writeln;
writeln('Author E-mail:123bd123@163.com 370114274@QQ.com Auther QQ:370114274':72);
writeln;
repeat
iv:=1;
write('Number 1:'); readln(n[1]);
repeat
ex:=1;
write('Method:1.+ 2.- 3.* 4./ Fix:'); read(fix);
if fix>4 then begin writeln; writeln('No Fix,Errer ID:12038'); writeln; ex:=0; end else begin
write('Number 2:'); readln(er);
if fix=1
Then s:=n[1]+m[1]
Else if fix=2
Then s:=n[1]-m[1]
Else if fix=3
Then s:=n[1]*m[1]
Else if fix=4
Then s2:=n[1]/er
end;
until ex=1;
write('Result:',s:0:2);
writeln;
repeat
we:=1;
write('Is There anything Else? Fix:1.ExiT 2.Resume ');read(ye);
if ye=1 then begin io:=1; iv:=1; end
else if ye=2 then begin io:=0; iv:=0;for i:=1 to 80 do
write('-'); end
else begin
writeln;
writeln('No Fix Error ID:12075'); we:=0; iv:=0; end;
writeln;
until we=1;
until iv=1;
end.
用TP编译、运行成功,FP没试过。