Untitled
#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); }