Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main()
- {
- long double x1, y1, x2, y2, x3, y3, q;
- cin>>x1;
- cin>>y1;
- cin>>x2;
- cin>>y2;
- cin>>x3;
- cin>>y3;
- q=(((x1-x3)*(y2-y3))-((x2-x3)*(y1-y3)))/2;
- if (q<0) {q=-q;
- }
- cout<<fixed<<setprecision(1)<<q<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement