Advertisement
Spocoman

02. Triangle Area

Aug 31st, 2023 (edited)
780
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     double a, h;
  7.     cin >> a >> h;
  8.  
  9.     double area = a * h / 2;
  10.  
  11.     cout.setf(ios::fixed);
  12.     cout.precision(2);
  13.    
  14.     cout << area << endl;
  15.  
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement