Untitled
unknown
plain_text
3 years ago
349 B
3
Indexable
#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);
}Editor is loading...