Информатика в алфавите формального языка четыре знака. каждое слово состоит из одинакогово числа букв. известно,что можно составить ровно 1024 слова этого языка. определить число букв в каждом слове?
Var ar:array[1..s] of integer; n,m,i:integer; begin writeln('N'); readln(n); writeln('M'); readln(m); writeln('Array:'); for i:=1 to s do readln(ar[i]); writeln('First array:'); for i:=1 to s do begin write(ar[i]:4); if ar[i] div n<>0 then ar[i]:=ar[i]+m; end; writeln; writeln('Final array:'); for i:=1 to s do write(ar[i]:4); end.
Пример ввода: 3 3 1 2 3 4 5 Пример вывода: First array: 1 2 3 4 5 Final array: 1 2 6 7 8
an ancient greek legend, the uninvited wedding goddess of discord and strife eris threw a wedding table a golden apple, on which was written a single word - "the most beautiful". were on olympus hera, athena and aphrodite arguing who should own this apple. each of them was rightfully deserves to own an apple, and even zeus refused to be their judge. he took the apple, gave it to hermes and told to withdraw goddesses in the neighborhood of troy, mount olympus, where they had to decide the dispute son of king priam of troy, paris. hera promised paris power over the whole of asia, athena - the glory and victory, and aphrodite promised him in marriage elenu.uslyhav wonderful promise of aphrodite, paris gave the apple of paris ey.afrodita helped kidnap helen, wife of spartan king menelaus, which later was the cause of the trojan war .
Const
s=5;
Var
ar:array[1..s] of integer;
n,m,i:integer;
begin
writeln('N');
readln(n);
writeln('M');
readln(m);
writeln('Array:');
for i:=1 to s do
readln(ar[i]);
writeln('First array:');
for i:=1 to s do
begin
write(ar[i]:4);
if ar[i] div n<>0 then ar[i]:=ar[i]+m;
end;
writeln;
writeln('Final array:');
for i:=1 to s do
write(ar[i]:4);
end.
Пример ввода:
3
3
1
2
3
4
5
Пример вывода:
First array:
1 2 3 4 5
Final array:
1 2 6 7 8
//Блок-схема во вложении
an ancient greek legend, the uninvited wedding goddess of discord and strife eris threw a wedding table a golden apple, on which was written a single word - "the most beautiful". were on olympus hera, athena and aphrodite arguing who should own this apple. each of them was rightfully deserves to own an apple, and even zeus refused to be their judge. he took the apple, gave it to hermes and told to withdraw goddesses in the neighborhood of troy, mount olympus, where they had to decide the dispute son of king priam of troy, paris. hera promised paris power over the whole of asia, athena - the glory and victory, and aphrodite promised him in marriage elenu.uslyhav wonderful promise of aphrodite, paris gave the apple of paris ey.afrodita helped kidnap helen, wife of spartan king menelaus, which later was the cause of the trojan war .