Program pr;uses crt;Var a, b, c,x1,x2,x3:integer;BeginWriteln('Введите a, b, c');readln(a, b, c);if (a<=b) and (b<=c) then Begin a:=a*a*a; b:=b*b*b; c:=c*c*c; Writeln(a); Writeln(b); Writeln(c); end;if (a>b) and (b>c) thenBegina:=a*(-1);b:=b*(-1);c:=c*(-1);Writeln(a);Writeln(b);Writeln(c);end
elseif (a<b) and (a<c) then Begin b:=a; c:=a; Writeln(a); Writeln(b); Writeln(c); end;if (b<a) and (b<c) then Begin a:=b; c:=b; Writeln(a); Writeln(b); Writeln(c); end;if (c<a) and (c<b) then Begin a:=c; b:=c; Writeln(a); Writeln(b); Writeln(c); end;readln;end.
1) (первые 2 скриншота)
#include <iostream>using std::cout;using std::endl;#include <cstdlib>using std::rand;using std::srand;#include <ctime>using std::time;int main(){ int a[10]; srand(time(0)); for(int i = 0; i < 10; i++) { a[i] = rand() % 101; cout << a[i] << ' '; } cout << endl << endl; for(int i = 0; i < 10; i++) { if(a[i] % 3 == 0 && a[i] > 13) { cout << a[i] << ' '; } } cout << endl; return 0;}
2)
#include <iostream>using std::cout;using std::endl;int main(){ double a[10] = { 1.2, 0.0, -5.8, -0.4, 10.5, 14.6, -6.3, -8.8, -4.1, 0.0 }; int A = 0, B = 3; for(int i = 0; i < 10; i++) { cout << a[i] << ' '; if(a[i] < 0.0) { a[i] += a[A]; } else if(a[i] == 0) { a[i] -= B; } } cout << "\n\na(index) = " << A << ", b = " << B << "\n\n"; for(int i = 0; i < 10; i++) { cout << a[i] << ' '; } cout << endl; return 0;}
Program pr;
uses crt;
Var a, b, c,x1,x2,x3:integer;
Begin
Writeln('Введите a, b, c');
readln(a, b, c);
if (a<=b) and (b<=c) then
Begin
a:=a*a*a;
b:=b*b*b;
c:=c*c*c;
Writeln(a);
Writeln(b);
Writeln(c);
end;
if (a>b) and (b>c) then
Begin
a:=a*(-1);
b:=b*(-1);
c:=c*(-1);
Writeln(a);
Writeln(b);
Writeln(c);
end
else
if (a<b) and (a<c) then Begin b:=a; c:=a; Writeln(a); Writeln(b); Writeln(c); end;
if (b<a) and (b<c) then Begin a:=b; c:=b; Writeln(a); Writeln(b); Writeln(c); end;
if (c<a) and (c<b) then Begin a:=c; b:=c; Writeln(a); Writeln(b); Writeln(c); end;
readln;
end.
1) (первые 2 скриншота)
#include <iostream>
using std::cout;
using std::endl;
#include <cstdlib>
using std::rand;
using std::srand;
#include <ctime>
using std::time;
int main()
{
int a[10];
srand(time(0));
for(int i = 0; i < 10; i++)
{
a[i] = rand() % 101;
cout << a[i] << ' ';
}
cout << endl << endl;
for(int i = 0; i < 10; i++)
{
if(a[i] % 3 == 0 && a[i] > 13)
{
cout << a[i] << ' ';
}
}
cout << endl;
return 0;
}
2)
#include <iostream>
using std::cout;
using std::endl;
int main()
{
double a[10] = { 1.2, 0.0, -5.8, -0.4, 10.5, 14.6, -6.3, -8.8, -4.1, 0.0 };
int A = 0, B = 3;
for(int i = 0; i < 10; i++)
{
cout << a[i] << ' ';
if(a[i] < 0.0)
{
a[i] += a[A];
}
else if(a[i] == 0)
{
a[i] -= B;
}
}
cout << "\n\na(index) = " << A << ", b = " << B << "\n\n";
for(int i = 0; i < 10; i++)
{
cout << a[i] << ' ';
}
cout << endl;
return 0;
}