Parašė PonasLukas· 2014 Kov. 29 09:03:14
#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
float coliai(float m) {
return m/0.0254;
}
float pedos(float m) {
return coliai(m)/12;
}
float jardai(float m) {
return pedos(m)/3;
}
int main()
{
ofstream rez("rezultatas.txt");
rez << "Metrai\tColiai\tPedos\tJardai" << endl;
for (int i = 1; i <= 5; i++) {
rez << i << "\t\t" << setprecision(4) << coliai(i) << "\t" << setprecision(3) << pedos(i) << "\t" << setprecision(3) << jardai(i) << endl;
}
rez.close();
return 0;
}