uses crt; var a:array [1..10] of integer; x: real; i:integer; begin clrscr; x:=0; for i:=1 to 10 do readln(A[i]); for i:=1 to 10 do begin if (A[i]<0) or (A[i] mod 2=0) then x:=x+Sqr(A[i]); end; writeln; write(x); end.
2)
program two; uses crt; var a:array [1..52] of integer; x,i: integer; begin clrscr; x:=34; for i:=1 to 52 do begin A[i]:=1+x; x:=x+1; if (A[i] mod 7 =1)or (A[i] mod 7 =2) or (A[i] mod 7 =5) then writeln(A[i]); end; end.
3)
Program three; Uses crt; var n,x:integer; a,y:real; begin Clrscr; readln(a,n); for x:=1 to n do y:=x*a; writeln(y); end.
4)
Program four; Uses crt; var A:array [1..100] of integer; n,i,max,x:integer; begin clrscr; writeln('vvedite kol-vo elementov'); readln(n); writeln('Vvedite elementy'); for i:=1 to n do read(A[i]); for i:=1 to n do begin max:=A[1]; if (A[i] <0) and (A[i]>A[x]) then max:=A[i]; x:=i; end; writeln ('Naib',max,'nomer',x); end.
5)
Program abc; Uses crt; var S,a,b:integer; begin clrscr; S:=0; a:=1; b:=3; while a<98 do begin while b<100 do begin S:=S+b-a; a:=a+4; b:=b+4; end; end; writeln(s); end.
В паскале
1) program one;
uses crt;
var a:array [1..10] of integer;
x: real; i:integer;
begin
clrscr;
x:=0;
for i:=1 to 10 do
readln(A[i]);
for i:=1 to 10 do
begin
if (A[i]<0) or (A[i] mod 2=0) then
x:=x+Sqr(A[i]);
end;
writeln;
write(x);
end.
2)
program two;
uses crt;
var a:array [1..52] of integer;
x,i: integer;
begin
clrscr;
x:=34;
for i:=1 to 52 do
begin
A[i]:=1+x;
x:=x+1;
if (A[i] mod 7 =1)or (A[i] mod 7 =2) or (A[i] mod 7 =5)
then writeln(A[i]);
end;
end.
3)
Program three;
Uses crt;
var n,x:integer; a,y:real;
begin
Clrscr;
readln(a,n);
for x:=1 to n do
y:=x*a;
writeln(y);
end.
4)
Program four;
Uses crt;
var A:array [1..100] of integer;
n,i,max,x:integer;
begin
clrscr;
writeln('vvedite kol-vo elementov');
readln(n);
writeln('Vvedite elementy');
for i:=1 to n do
read(A[i]);
for i:=1 to n do
begin
max:=A[1];
if (A[i] <0) and (A[i]>A[x])
then max:=A[i];
x:=i;
end;
writeln ('Naib',max,'nomer',x);
end.
5)
Program abc;
Uses crt;
var S,a,b:integer;
begin
clrscr;
S:=0;
a:=1;
b:=3;
while a<98 do
begin
while b<100 do
begin
S:=S+b-a;
a:=a+4;
b:=b+4;
end;
end;
writeln(s);
end.
Оператор Значение Пример
+ добавление 4 + 5
— вычитание 8 — 3
* умножение 5 * 5
/ деление 4 / 2
% остаток от деления 7 % 2
** возведение в степень 2 ** 3
// целочисленное деление 15 // 4
Оператор Пример Так же как
= x = 5 x = 5
+= x += 3 x = x + 3
-= x -= 3 x = x — 3
*= x *= 3 x = x * 3
/= x /= 3 x = x / 3
%= x %= 3 x = x % 3
//= x //= 3 x = x // 3
**= x **= 3 x = x ** 3
&= x &= 3 x = x & 3
|= x |= 3 x = x | 3
^= x ^= 3 x = x ^ 3
>>= x >>= 3 x = x >> 3
<<= x <<= 3 x = x << 3
Оператор Значение Пример
== равно x == y
!= не равно x != y
> больше чем x > y
< меньше чем x < y
>= больше чем или равно x >= y
<= меньше чем или равно x <=
лучший ответ!