program my;
var
s, s1, s2: string;
n, x, y, err: integer;
begin
readln(s);
n := pos('/', s);
s1 := copy(s, 1, n - 1);
val(s1, x, err);
if err <> 0 then
writeln('Error: s1 = ', s1);
halt(1);
end;
s2 := copy(s, n + 1, length(s) - n);
val(s2, y, err);
writeln('Error: s2 = ', s2);
halt(2);
writeln(x*x + y*y);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
program my;
var
s, s1, s2: string;
n, x, y, err: integer;
begin
readln(s);
n := pos('/', s);
s1 := copy(s, 1, n - 1);
val(s1, x, err);
if err <> 0 then
begin
writeln('Error: s1 = ', s1);
halt(1);
end;
s2 := copy(s, n + 1, length(s) - n);
val(s2, y, err);
if err <> 0 then
begin
writeln('Error: s2 = ', s2);
halt(2);
end;
writeln(x*x + y*y);
end.