ответ:
объяснение:
1) без составных условий.
program abc;
var x,y,v: real;
begin
readln(x,y);
if (x> 1) then
begin
if (y> 1) then
v: =x+y
else
v: =x-y;
end
else begin
if (y> 1) then
v: =-x+y
else
v: =-x-y;
end;
writeln(v);
end.
2) с составным.
program abc;
var x,y,v: real;
begin
readln(x,y);
if (x> 1) and (y> 1) then
v: =x+y;
if (x> 1) and (y< =1) then
v: =x-y;
if (x< =1) and (y< =1) then
v: =-x-y;
if (x< =1) and (y> 1) then
v: =-x+y;
writeln(v);
end.
#include
using namespace std;
int main()
{
const int n = 50;
int x[50];
srand(time(0));
for (int i = 1; i < n; i++)
{
x[i] = rand() % 199 - 99;
cout < < x[i] < < " ";
}
cout < < endl;
for (int i = 1; i < n; i++)
if (x[i] < 0)
cout < < x[i] < < " ";
cout < < endl;
for (int i = 1; i < n; i++)
if (x[i] > 0)
cout < < x[i] < < " ";
return 0;
}
Поделитесь своими знаниями, ответьте на вопрос: