" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2025 KUDO.TIPS - All rights reserved.
#include <fstream>
using namespace std;
int main(int argc, char *argv[])
{
fstream in;
fstream out;
in.open("wejscie.txt", fstream::in);
if(in.is_open())
{
float a, b;
in >> a;
in >> b;
in.close();
if(a != 0)
{
out.open("wyjscie.txt", fstream::out);
if(out.is_open())
{
float x = -b/a;
out<<x;
out.close();
cout<<"Zapis zakonczony powodzeniem"<<endl;
}
else cout<<"Blad tworzenia inu - wyjscie.txt"<<endl;
} else cout<<"Brak miejsca zerowego"<<endl;
}
else cout<<"Blad otwierania inu - wejscie.txt"<<endl;
system("PAUSE");
return 0;
}