Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
349 B
0
Indexable
Never
#include <iostream>
#include <fstream>
#include <math.h>
#include  <iomanip>
using namespace std;
double volume(int a, int h) // V=1/3Sh
{
	double V;
	return V = (1.0 / 3.0) * (a*a) * h;
};
int main() 
{
	ifstream in("pyraminx.txt");
	ofstream out("S.txt");
	int a, b, h;  in >> a >> b >> h;
	out << setprecision(3) << volume(a,h);
}