var i,k,j,s:integer;
begin
readln(k);
FOR I:=100 TO 300 DO
begin
s:=0;
for j:=1 to i do
if i mod j=0 then s:=s+j;
if s=k then writeln(i);
end;
end.
#include <iostream>
#include <math.h>
using namespace std;
class Vertice {
public:
double x, y;
friend istream &operator>>(istream &is, Vertice &v) {
is >> v.x >> v.y ;
}
double distance(Vertice &w);
};
double Vertice::distance(Vertice &w) {
return sqrt( pow(this->x-w.x,2) + pow(this->y-w.y,2));
}
class Triangle {
public:
Vertice a, b, c;
Triangle(Vertice v, Vertice w, Vertice u);
double Square();
double Perimetr();
};
Triangle::Triangle(Vertice v, Vertice w, Vertice u) {
this->a = v, this->b = w, this->c = u;
}
double Triangle::Perimetr() {
return this->a.distance(this->b) + this->a.distance(this->c) + this->b.distance(this->c);
}
double Triangle::Square() {
double a = this->a.distance(this->b), b = this->b.distance(this->c), c = this->a.distance(this->c),
p = (a+b+c)/2;
return sqrt(p*(p-a)*(p-b)*(p-c));
}
int main() {
Vertice a, b , c;
cin >> a >> b >> c;
Triangle t(a,b,c);
cout << t.Perimetr() << endl << t.Square() << endl;
}
//язык c++, ООП
Готово. Запрос на ввод, условие и вывод.