initial
This commit is contained in:
commit
2802401eee
79 changed files with 2650 additions and 0 deletions
16
1sem/programming basics/2/1.cpp
Normal file
16
1sem/programming basics/2/1.cpp
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// pb_2_1.cpp
|
||||
// Горбацевич Андрей
|
||||
#include <stdio.h>
|
||||
#include <cmath>
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
double x1, y1, x2, y2, x3, y3;
|
||||
printf("x1 y1 x2 y2 x3 y3 >>>");
|
||||
scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3);
|
||||
double S = ((x1 - x3)*(y2 - y3) - (x2 - x3)*(y2 - y3)) / 2.f;
|
||||
// 1 | x1-x3 y1-y3 |
|
||||
// S = --- | |
|
||||
// 2 | x2-y3 y2-y3 |
|
||||
printf("S=%f", abs(S));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue