var i,A,B:integer;
ans:real;
f,g:text;
begin
assign(f,'input.txt');
assign(g,'output.txt');
reset(f);
rewrite(g);
readln(f,i);
read(f,A,B);
if (i=4) and (B=0)
then
write(g,'Error');
close(g);
exit;
end;
if (i=5) and (B=0)
case (i) of
1:ans:=A+B;
2:ans:=A-B;
3:ans:=A*B;
4:ans:=A div B;
5:ans:=A mod B;
write(g,ans);
close(f);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
var i,A,B:integer;
ans:real;
f,g:text;
begin
assign(f,'input.txt');
assign(g,'output.txt');
reset(f);
rewrite(g);
readln(f,i);
read(f,A,B);
if (i=4) and (B=0)
then
begin
write(g,'Error');
close(g);
exit;
end;
if (i=5) and (B=0)
then
begin
write(g,'Error');
close(g);
exit;
end;
case (i) of
1:ans:=A+B;
2:ans:=A-B;
3:ans:=A*B;
4:ans:=A div B;
5:ans:=A mod B;
end;
write(g,ans);
close(f);
close(g);
end.