program SumOfCubesAndSquares;
vara, b, c: real;sum: real;
begin// Input three real numberswrite('Enter the first number: ');readln(a);
write('Enter the second number: ');readln(b);
write('Enter the third number: ');readln(c);
// Calculate the sum based on the conditionssum := 0;if a >= 0 thensum := sum + power(a, 3)elsesum := sum + sqr(a);
if b >= 0 thensum := sum + power(b, 3)elsesum := sum + sqr(b);
if c >= 0 thensum := sum + power(c, 3)elsesum := sum + sqr(c);
// Output the resultwriteln('The sum of cubes for non-negative numbers and sum of squares for negative numbers is: ', sum:0:2);end.
program SumOfCubesAndSquares;
var
a, b, c: real;
sum: real;
begin
// Input three real numbers
write('Enter the first number: ');
readln(a);
write('Enter the second number: ');
readln(b);
write('Enter the third number: ');
readln(c);
// Calculate the sum based on the conditions
sum := 0;
if a >= 0 then
sum := sum + power(a, 3)
else
sum := sum + sqr(a);
if b >= 0 then
sum := sum + power(b, 3)
else
sum := sum + sqr(b);
if c >= 0 then
sum := sum + power(c, 3)
else
sum := sum + sqr(c);
// Output the result
writeln('The sum of cubes for non-negative numbers and sum of squares for negative numbers is: ', sum:0:2);
end.