
Помогите даю 15балов Напишите на Pascal Даны два числа a и b . Число а возвести в квадрат, число
b возвести в куб. Вычислить сумму получившихся чисел . Результат запомнить в переменной Z

Ответы на вопрос

var
a,b,z:integer;
begin
readln(a);
readln(b);
z:=0;
a:=a*a;
b:=b*b*b;
z:=a+b;
writeln(z);
end.



```pascal program SquareAndCube; var a, b, Z: integer; begin writeln('Enter the value of a: '); readln(a); writeln('Enter the value of b: '); readln(b); Z := sqr(a) + b * b * b; writeln('The sum of the square of a and the cube of b is: ', Z); end. ```
This Pascal program prompts the user to enter two numbers, `a` and `b`. It then calculates the square of `a` using the `sqr` function and the cube of `b` by multiplying `b` by itself twice. The sum of the square of `a` and the cube of `b` is stored in the variable `Z`. Finally, the program displays the value of `Z`.
Please note that the program assumes the input values for `a` and `b` are integers. If you want to use floating-point numbers, you can change the data type from `integer` to `real` in the variable declarations and use the `sqr` function for `b` as well.


Похожие вопросы
Топ вопросов за вчера в категории Информатика








Последние заданные вопросы в категории Информатика
-
Математика
-
Литература
-
Алгебра
-
Русский язык
-
Геометрия
-
Английский язык
-
Химия
-
Физика
-
Биология
-
Другие предметы
-
История
-
Обществознание
-
Окружающий мир
-
География
-
Українська мова
-
Информатика
-
Українська література
-
Қазақ тiлi
-
Экономика
-
Музыка
-
Право
-
Беларуская мова
-
Французский язык
-
Немецкий язык
-
МХК
-
ОБЖ
-
Психология
-
Физкультура и спорт
-
Астрономия
-
Кыргыз тили
-
Оʻzbek tili