Treść zadania: Program który pobierze dane z pliku wejsciowego, obliczy kwadraty liczb i wyniki zapisze w pliku wyjsciowym.
Co ja robię tu źle???
#include <iostream>
#include <cmath>
#include <iomanip>
#include <fstream>
using namespace std;
int x,a;
int main ()
{
std::fstream file;
file.open("dane.txt", std::ios::in);
if (!file.is_open()) {
return -1;
}
int x = 0;
int input;
while (file >> input) {
x=pow(a,2);
}
file.close();
std::cout << "Wynik: " << x << "\n";
file.open("potega.txt", std::ios::out);
if (!file.is_open())
return 0;
}