a = input()
b = input()
d1 = a[0:2]
m1 = a[2:4]
y1 = a[4:]
d2 = b[0:2]
m2 = b[2:4]
y2 = b[4:]
if y1 > y2:
print('Кулинарный фестиваль бутерброда')
elif y1 < y2:
print('Соревнование по прыжкам с табуретки')
else:
if m1 > m2:
print('Кулинарный фестиваль бутерброда')
elif m1 < m2:
print('Соревнование по прыжкам с табуретки')
else:
if d1 > d2:
print('Кулинарный фестиваль бутерброда')
elif d1 < d2:
print('Соревнование по прыжкам с табуретки')
else:
print('В один день')
#include <iostream>
#include <cmath>
#include <Windows.h>
using namespace std;
int main()
{
SetConsoleCP(65001);
SetConsoleOutputCP(65001);
float x, y;
cout << "Input X: ";
cin >> x;
cout << "Input Y: ";
cin >> y;
if(sqrt(x * x + y * y) < 1 || abs(x) > 1 || abs(y) > 1){
cout << "Точка вне области";
}
else if( (x > 0 && y > 0) || (x < 0 && y < 0))
cout << "Точка внутри заштрихованной области";
else
cout << "Точка вне области";
return 0;
}
У меня получилось 6, но если ответ другой должен получиться, то надеюсь разберешься там с прогой и исправишь
Объяснение:
var x,y,n,b,c,q:integer;
f:array [-1..1000] of integer;
begin
for var i:=1 to 1000 do begin
if i<=15 then
f[i]:=2*i*i+4*i+3;
if (i>15) then
if (i mod 3=0) then
f[i]:= f[n-1]+i*i+3
else
F[i]:= f[i-2]+i-6;
end;
for var i:=1 to 1000 do begin
x:=f[i];
while x>0 do begin
b:=x mod 10;
x:=x div 10;
if b mod 2=0 then begin
q+=1; break;
end;
end;
if q=0 then
c+=1;
end;
writeln (F);
writeln (c);
end.