Advertisement
rengetsu

ProcedurProgramavimas_1.08

Feb 20th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3.  
  4. using namespace std;
  5. int main()
  6. {
  7. long double x1, y1, x2, y2, x3, y3, q;
  8. cin>>x1;
  9. cin>>y1;
  10. cin>>x2;
  11. cin>>y2;
  12. cin>>x3;
  13. cin>>y3;
  14.  
  15. q=(((x1-x3)*(y2-y3))-((x2-x3)*(y1-y3)))/2;
  16. if (q<0) {q=-q;
  17.     }    
  18.    
  19. cout<<fixed<<setprecision(1)<<q<<endl;
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement