1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
#include <iostream>
#include <fstream>
#include <string>
#include <stdlib.h>
using namespace std;
int main ()
{
string x1, y1, z1;
double x, y, z, smallest, largest, sum, mean, median;
fstream in2;
in2.open("in2.txt");
if (in2)
{
std::getline( in2, x1 );
std::getline( in2, y1 );
std::getline( in2, z1 );
}
//Convert string to double
x = strtod (x1, NULL);
y = strtod (y1, NULL);
z = strtod (z1, NULL);
|