37 div 10 = 3
58 div 10 = 5
125 div 10 = 12
234 div 10 = 23
873 div 100 = 8
3985 div 1000 = 3
37 mod 10 = 7
58 mod 10 = 8
125 mod 10 = 5
234 mod 10 = 4
873 mod 100 = 73
3985 mod 1000 = 985
Begin
write(ReadSeqInteger(ReadInteger()).Where(x -> x mod 3 = 0).Sum);
end.
Var x1, y1, x2, y2, x3, y3, P: real;
function length(x1: real; y1: real; x2: real; y2: real): real;
begin
length := sqrt(sqr(x1 - x2) + sqr(y1 - y2));
end;
begin
read(x1, y1, x2, y2, x3, y3);
P := length(x1, y1, x2, y2) + length(x3, y3, x2, y2) + length(x1, y1, x3, y3);
writeln('Perimeter is ', P);
<span>end.
------------------------------
#include <cmath>
#include <iostream>
float length(float x1, float y1, float x2, float y2)
{
return pow((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2), 0.5);
}
int main()
{
float x1, y1, x2, y2, x3, y3, P;
std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
P = length(x1, y1, x2, y2) + length(x3, y3, x2, y2) + length(x1, y1, x3, y3);
std::cout << "Perimeter is " << P;
<span>}</span></span>