Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
349 B
2
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(2) << volume(a,h);
}