Program Rastoyanie; var x1,x2,y1,y2,S:real; begin write('введите координаты'); readln(x1,x2,y1,y2); S:=sqrt(sqr(x2-x1)+sqr(y2-y1)); writeln(s); readln; end.
var pos,neg: integer; i,k,x: integer; ev,un: integer; a,b: array [1..n] of integer;
begin for i := 1 to n do read(a[i]); k := 0; pos := 0; neg := 0; for i := 1 to n do begin ev := 0; un := 0; x := a[i]; if x <> 0 then if x > 0 then if (x < pos) or (pos = 0) then pos := x else else if (x > neg) or (neg = 0) then neg := x; x := abs(x); while x <> 0 do begin if odd(x) then un := un + 1 else ev := ev + 1; x := x div 10 end; if un = ev then begin k := k + 1; b[k] := a[i] end end;
writeln(pos,' ',neg); for i := 1 to k do write(b[i],' ') end.
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
double x1,x2,y1,y2,S;
cout<<"Введите координаты"<<endl;
cin>>x1>>x2>>y1>>y2;
S=sqrt(pow((x2-x1),2) + pow((y2-y1),2));
cout<<S<<endl;
return 0;
}
ответ на вопрос из комментария:
#include <iostream>
using namespace std;
int main()
{
int m;
cin>>m;
cout<<m<<" кг, содержит полных тонн "<<m/1000<<endl;
return 0;
}