Program R1;
Var a:array[1..100] of integer;
i,n:integer;
begin
assign(input,'input.txt');
reset(input);
assign(output,'output.txt');
rewrite(output);
readln(n);
for i:=1 to n do read(a[i]);
for i:=n+1 downto 2 do
a[i]:=a[i-1] ;
a[1]:=7 ;
for i:=1 to n+1 do write(a[i],' ');
close(input);
close(output);
end.
например
ввод
4
1 2 3 4
вывод
7 1 2 3 4
#include<fstream>
#include <iostream>
#include <algorithm>
#include <string>
#include <map>
int main()
{
std::string fname;
//ввод названия текстового файла
std::cin >> fname;
std::ifstream file(fname);
std::string text((std::istreambuf_iterator<char>(file)) ,std::istreambuf_iterator<char>());
file.close();
std::map<char, char> rs = {{'9', '0'}};
for (char i = '0'; i < '9'; ++i) rs.insert({ i,i+1 });
char r;
std::replace_if(text.begin(), text.end(), [&](char c) { return r = rs[c]; }, r);
std::ofstream out("result.txt");
out << text << std::endl;
out.close();
return 0;
}
var a,b,c,x,z: double;
begin
a:=4; b:=-1; c:=0;
while (a=4) do
begin
write('Введите a: ');
readln(a);
if (a=4) then writeln('a не может быть равно 4!');
end;
while (b<=0) do
begin
write('Введите b: ');
readln(b);
if (b<=0) then writeln('b не может быть меньше или равно 0!');
end;
while (c=0) do
begin
write('Введите c: ');
readln(c);
if (c=0) then writeln('c не может быть равно 0!');
end;
x:=(7*a*b+(1/(c*c)))/(4-a);
z:=a+(x/sqrt(2*b));
writeln('x = ');
writeln(x);
writeln('z = ');
writeln(z);
end.
var a:array [1..100] of integer;
i,n:integer;
Begin
read(n);
for i:= 1 to n do
read(a[i]);
for i:= n downto 1 do
a[i+1]:=a[i];
a[1]:=7;
for i:=1 to n+1 do
write(a[i],' ');
End.