if a>2*r then writeln('proidet') else writeln('ne proidet');
end.
var a:array[1..100]of integer;
s,i,n:integer;
begin
readln(n);
for i:=1 to n do readln(a[i]);
for i:=2 to n-1 do begin
if a[i]<(a[i-1]+a[i+1])/2 then s:=s+1;
end;
writeln(s);
end.
function Fib(b:integer):integer; begin if (b<=1) then Fib:=b else Fib := Fib(b - 1)+Fib(b - 2) ; end;
var a:integer; begin readln(a); writeln(fib(a)); end.
var m,k:integer;
begin
readln(m);
k:=m div 4;
writeln(k);
end.
var a:array[1..10]of integer; i,n,k:integer; begin readln(n); for i:=1 to n do readln(a[i]); for i:=1 to (n div 2) do begin k:=a[n-i+1]; a[n-i+1]:=a[i]; a[i]:=k; end; for i:=1 to n do write(a[i],' '); end.
var a,r:real;
begin
readln(a,r);
if a>2*r then writeln('proidet') else writeln('ne proidet');
end.
var a:array[1..100]of integer;
s,i,n:integer;
begin
readln(n);
for i:=1 to n do readln(a[i]);
for i:=2 to n-1 do begin
if a[i]<(a[i-1]+a[i+1])/2 then s:=s+1;
end;
writeln(s);
end.
function Fib(b:integer):integer;
begin
if (b<=1) then
Fib:=b
else
Fib := Fib(b - 1)+Fib(b - 2) ;
end;
var a:integer;
begin
readln(a);
writeln(fib(a));
end.
var m,k:integer;
begin
readln(m);
k:=m div 4;
writeln(k);
end.
var a:array[1..10]of integer;
i,n,k:integer;
begin
readln(n);
for i:=1 to n do readln(a[i]);
for i:=1 to (n div 2) do begin
k:=a[n-i+1];
a[n-i+1]:=a[i];
a[i]:=k;
end;
for i:=1 to n do write(a[i],' ');
end.
странное задание, но все же:
#include <string>
#include <vector>
#include <iostream>
bool compose( std::vector<std::wstring> &input, std::wstring result )
{
for( int i = 0; i < result.size(); ++i ) {
bool found( false );
for( int j = 0; j < input.size(); ++j ) {
if( input[j].find( result[i] ) != -1 ) {
found = true;
input[j].erase( input[j].begin() + input[j].find( result[i] ) );
}
}
if( found == false )
return false;
}
std::wcout << L"\n";
for( int i = 0; i < input.size(); ++i )
{
std::wcout << input[i] << L"\n";
}
std::wcout << L"\n";
std::wcout << result << L"\n";
std::wcout << L"\n";
return true;
}
int main(int argc, wchar_t* argv[])
{
std::vector<std::wstring> v1;
v1.push_back( L"ИНСТРУМЕНТЫ" );
compose( v1, L"СТРУНЫ" );
std::vector<std::wstring> v2;
v2.push_back( L"ИНСТРУМЕНТЫ" );
compose( v2, L"ТРУС" );
std::vector<std::wstring> v3;
v3.push_back( L"ИНСТРУМЕНТЫ" );
compose( v3, L"ТУРИСТ" );
std::vector<std::wstring> v4;
v4.push_back( L"ШИШКА" );
v4.push_back( L"ФЛАГ" );
v4.push_back( L"ТРОС" );
compose( v4, L"ШРИФТ" );
std::wstring text;
std::wcout << L"\nТекст:";
std::wcin >> text;
int count = 0;
for( int i = 0; i < text.size(); ++i ) {
if( text[i] == L'M' )
++count;
}
std::wcout << L"\nколичество M: " << count;
return 0;
}