Program N70231806_1; var a:array[ 1 .. 10 ] of shortint; i:byte; t:shortint; begin randomize; writeln('Исходный массив: '); for i := 1 to 10 do begin a[ i ] := random(21) - 10; write(a[ i ]:4) end; writeln; t := a[ 10 ]; for i := 10 downto 2 do a[ i ] := a[ i - 1 ]; a[ 1 ] := t; writeln('Результат: '); for i := 1 to 10 do write(a[ i ]:4); readln end.
2) program N70231806_2; var a:array[ 1 .. 12 ] of shortint; i, j:byte; t:shortint; begin randomize; writeln('Исходный массив: '); for i := 1 to 12 do begin a[ i ] := random(25) - 10; write(a[ i ]:4) end; writeln; for j := 1 to 4 do begin t := a[ 12 ]; for i := 12 downto 2 do a[ i ] := a[ i - 1 ]; a[ 1 ] := t end; writeln('Результат: '); for i := 1 to 12 do write(a[ i ]:4); readln end.
#include <iostream>
#include <Windows.h>
int main()
{
int v;
double S, t, t1, tmpT,tmpT1,b,tmpT3;
std::cout << "V - km\h: ";
std::cin >> v;
std::cout << "\nS - km: ";
std::cin >> S;
std::cout << "\nT - hour: ";
std::cin >> t;
std::cout << "\nT1 - minut: ";
std::cin >> t1;
tmpT = S / v;
t -= tmpT;
tmpT3 = t - tmpT;
if (tmpT3 < t)
{
std::cout << "edem bez ostanovok" << std::endl;
system("pause");
exit(1);
}
tmpT1 = (t * 60) / t1;
b = (double)(int)tmpT1;
std::cout << "kol ostanovok: " << b << std::endl;
system("pause");
}
var a:array[ 1 .. 10 ] of shortint;
i:byte;
t:shortint;
begin
randomize;
writeln('Исходный массив: ');
for i := 1 to 10 do
begin
a[ i ] := random(21) - 10;
write(a[ i ]:4)
end;
writeln;
t := a[ 10 ];
for i := 10 downto 2 do
a[ i ] := a[ i - 1 ];
a[ 1 ] := t;
writeln('Результат: ');
for i := 1 to 10 do
write(a[ i ]:4);
readln
end.
2)
program N70231806_2;
var a:array[ 1 .. 12 ] of shortint;
i, j:byte;
t:shortint;
begin
randomize;
writeln('Исходный массив: ');
for i := 1 to 12 do
begin
a[ i ] := random(25) - 10;
write(a[ i ]:4)
end;
writeln;
for j := 1 to 4 do
begin
t := a[ 12 ];
for i := 12 downto 2 do
a[ i ] := a[ i - 1 ];
a[ 1 ] := t
end;
writeln('Результат: ');
for i := 1 to 12 do
write(a[ i ]:4);
readln
end.