OOP HomeWork

This commit is contained in:
e2hang
2025-08-11 00:01:30 +08:00
commit e8a5ca2363
119 changed files with 3187 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
#include <iostream>
#include "t_area.h"
using namespace std;
int main() {
double a, b, c;
cin >> a >> b >> c;
cout << triangle_area(a,b,c) << endl;
return 0;
}

View File

@@ -0,0 +1,5 @@
#include <cmath>
double triangle_area(double a, double b, double c) {
double s = (a + b + c) / 2;
return sqrt(s * (s - a) * (s - b) * (s - c));
}

View File

@@ -0,0 +1,8 @@
#pragma once
#ifndef tarea
#define tarea
double triangle_area(double a, double b, double c);
#endif // !tarea