Program rabota_s_massivom; const N = 10; var M : array[1..N] of integer; i, max, nowMax, maxIndex, index, summ : integer; begin for i := 1 to N do readln(M[i]); for i := 1 to N do begin if M[i] mod 2 > 0 then begin if nowMax = 0 then index := i; nowMax := nowMax + 1; if (i = N) and (nowMax > max) then begin max := nowMax; maxIndex := index; end; end else if nowMax > max then begin max := nowMax; maxIndex := index; nowMax := 0; end; end; if max = 0 then writeln('Не существует') else begin summ := 0; for i := maxIndex to maxIndex + max - 1 do summ := summ + M[i]; writeln('Сумма: ', summ); end; end.
#inclued<bits/stdc++.h>
using namespace std;
int main()
{int d,m;
cin>>d>>m;
if (m==1)
{if (d>=20)
cout<<"vodoleey";
else cout<<"kozerog";}
if (m==2)
{if (d>=19)
cout<<"ribi";
else cout<<"vodoley";}
if (m==3)
{if (d>=21) cout<<"oven";
else cout<<"ribi";}
if (m==4)
{if (d>=20)
cout<<"telec";
else cout<<"oven";}
if (m==5)
{if (d>=21)
cout<<"blizneci";
else cout<<"telec";}
if (m==6)
{if (d>=22)
cout<<"rac";
else cout<<"blizneci";}
if (m==7)
{if (d>=23)
cout<<"lev";
else cout<<"rac";}
if (m==8)
{if (d>=23)
cout<<"deva";
else cout<<"lev";}
if (m==9)
{if (d>=23) cout<<"vesi";
else cout<<"deva";}
if (m==10)
{if (d>=23)
cout<<"scorpion";
else cout<<"vesi";}
if (m==11)
{if (d>=23)
cout<<"strelec";
else cout<<"scorpion";}
if (m==12)
{if(d>=22)
cout<<"kozerog";
else cout<<"strelec";}
return 0;
}