Объяснение:
h,w = int(input().split())
c,p = int(input().split())
s = []
roadm = []
parks = []
cp = []
for i in range(1, h+1):
for j in range(1, w+1):
s.append([i,j])
for k in s:
if k[0]==1 or k[1]==1:
roadm.append(s.pop(k))
for t in s:
if t[0] == 2 or t[1] == 2:
cp.append(s.pop(t))
for y in s:
if y[0] == (f[0]+1 for f in cp) and y[1] == (f[1]+1 for f in cp) and y[0] == (f[0]-1 for f in cp) and y[1] == (f[1]-1 for f in cp):
parks.append(s.pop(y))
a = []
b = []
for o in s:
a.append(o[0])
b.append(o[1])
print(min(a))
print(min(b))
#include <iostream>
#include <string>
#include <algorithm>
bool P(int value)
{
std::string left = std::to_string(value);
std::reverse(left.begin(), left.end());
std::string right = std::to_string(value);;
return left == right;
}
int main()
{
int n;
std::cin >> n;
int count = 0;
for (int i = 1; i <= n; ++i)
{
if (P(i))
{
count++;
}
}
std::cout << "Count palindrome: " << count << std::endl;
return 0;
}
Поделитесь своими знаниями, ответьте на вопрос:
Напишите программу рascal если х> 10 или х < 10 то у=х
begin
x:=0; y:=0;
read(x);
if (x<>10) then
y:=x;
writeln(x,' ',y);
end.