Var a, b, c: integer; begin readln(a, b, c); //вводим a b c if a > 0 then writeln(a*a) //если a > 0 вывести квадрат a else writeln(a); //иначе вывести a if b > 0 then writeln(b*b) //если b > 0 вывести квадрат b else writeln(b); //иначе вывести b if c > 0 then writeln(c*c) //если c > 0 вывести квадрат c else writeln(c); //иначе вывести c end.
Гаврилаш
16.12.2021
#include <iostream> #include <string> #include <time.h> using namespace std;
void main() { srand(time(NULL)); int n,k=0,k1=4; cin >> n; //вводишь количество символов string *s=new string [n]; for (int i = 0;i < n;++i) { while (k == k1) { k = rand() % 3; } switch (k) { case 0:s[i] = '0';cout << s[i];break; case 1:s[i] ='1';cout << s[i];break; //вместо 0,1,2 пишешь свой алфавит . case 2:s[i] ='2';cout << s[i];break; } k1 = k; } system("pause"); }
grigoriev8
16.12.2021
// PascalABC.NET 3.0, сборка 1128
procedure MatInput(M:array[,] of integer); begin var nr:=Length(M,0); var nc:=Length(M,1); WritelnFormat('Введите построчно массив размером {0}x{1}',nr,nc); for var i:=0 to nr-1 do for var j:=0 to nc-1 do Read(M[i,j]); end;
function S(M:array[,] of integer):integer; begin Result:=0; var Zero:integer; for var i:=0 to Length(M,0)-1 do begin Zero:=1; for var j:=0 to Length(M,1)-1 do if M[i,j]=0 then begin Zero:=0; Break end; Result+=Zero; if Result=1 then begin Result:=0; Exit end end; Result:=1 end;
begin var A:=new integer[3,4]; MatInput(A); var B:=new integer[3,3]; MatInput(B); Writeln(S(A)); Writeln(S(B)); end.
a, b, c: integer;
begin
readln(a, b, c); //вводим a b c
if a > 0 then writeln(a*a) //если a > 0 вывести квадрат a
else
writeln(a); //иначе вывести a
if b > 0 then writeln(b*b) //если b > 0 вывести квадрат b
else
writeln(b); //иначе вывести b
if c > 0 then writeln(c*c) //если c > 0 вывести квадрат c
else
writeln(c); //иначе вывести c
end.