Program cgt; var x1,y1,x2,a,y2,b,c,x3,y3:real; procedure IOI(x1,y1,x2,y2:real;var a:real); begin a:=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); end; begin read(x1,x2,y1,y2,x3,y3); IOI(x1,y1,x2,y2,a); IOI(x1,y1,x3,y3,b); IOI(x3,y3,x2,y2,c); if(a>=b)and(a>=c)then writeln('первая и вторая точка ',a) else if(b>=a)and(b>=c)then writeln('первая и третая точка ',b) else if(c>=b)and(c>=a)then writeln('третая и вторая точка ',c); end. 2) program cgt; var z,x,y:real;function IOI(x:real):real; begin if(x=0)then IOI:=0; if(x<0)then IOI:=-1; if(x>0)then IOI:=1; end; begin read(x,y); z:=(IOI(x)+IOI(Y))*IOI(x+y); writeln(z); end.
// PascalABC.NET 3.0, сборка 1073 const sb='bcdfgjklmnpqrstvwxz'; s='Computer programming is a process of computer programs creation'; var i,n:integer; s1,sn,t:string; begin i:=1; while s[i]<>' ' do Inc(i); s1:=Copy(s,1,i-1); n:=Length(s); i:=n; while s[i]<>' ' do Dec(i); sn:=Copy(s,i+1,n-i); t:=''; for i:=1 to Length(s1) do if Pos(s1[i],sb)>0 then t:=t+s1[i]; s1:=t; t:=''; for i:=1 to Length(sn) do if Pos(sn[i],sb)>0 then t:=t+sn[i]; sn:=t; t:=''; for i:=1 to Length(s1) do if Pos(s1[i],sn)>0 then if Pos(s1[i],t)=0 then t:=t+s1[i]; for i:=1 to Length(t) do Write(t[i],' '); Writeln end.
Тестовый прогон: t r
2. "Нормальное" решение
// PascalABC.NET 3.0, сборка 1073 const sb='bcdfgjklmnpqrstvwxz'; s='Computer programming is a process of computer programs creation'; begin var a:=s.ToWords(' '); a[0].Intersect(a[a.Length-1]).Where(x->Pos(x,sb)>0).Println(',') end.
Тестовый прогон: t,r
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota
Оформи подписку