Var
<span> K, s: </span>byte;
<span> A: array [0..4] of </span>byte;
begin
A[0] := 1; a[1] := 4; a[2] := 5; a[3] := 7; a[4] := 8;
for K := 0 to 4 do
s += a[k];
writeln(s);
<span>end.</span>
Ничего если я её сократил?
x = input()
if (len(x) == 4) and (x.isdigit()) and (1000<=int(x)<=9999):
print(str(int(x[0])+int(x[1])+int(x[2])+int(x[3]))+" "+str(int(x[0])*int(x[1])*int(x[2])*int(x[3])))
program n5;
uses crt;
var a,b,c,d,x:integer;
begin
read (a,b,c,d);
if (b=0) and (a<>0)then write('solution');
if (b<>0) and (a=0)then write('нет корней');
if (b<>0) and (a<>0) and (b mod a=0) then write (-b div a);
readln;
end.
using System;
namespace ConsoleApp11
{
class Program
{
static void Main(string[] args)
{
Console.Write("Введите N: ");
int N = int.Parse(Console.ReadLine());
double S = 0;
for (int i = 0; i < N; i++)
S += Math.Pow(-1, i) * (1 / Math.Pow(2, i));
Console.WriteLine("Ответ: " + S);
Console.ReadKey();
}
}
}
1)
uses crt;
var i:integer;
A:array[0..15] of integer;
begin
For i:= 0 to 15 do
A[i]:= i+1;
For i:= 0 to 14 do
A[i]:= A[i+1];
For i:=0 to 15 do
write(A[i],' ');
end.
2) Перемещает первый элемент массива в конец.