#include <iostream>
#include <fstream>
#include <string>
#include <math.h>
using namespace std;
void main()
{
const char* filename = "c:/解方程程序结果.txt";
ofstream ofile(filename);
if(!ofile.is_open())
{
std::cerr << "Error opening file";
exit(EXIT_FAILURE);
}
int y;
cout<<"输入Y:";
cin>>y;
ofile<<"输入y: "<<y<<endl;
int y3 = (int)pow(y,1.0/3.0) +1;
int y2 = (int)pow(y,1.0/2.0) +1;
int a=0,b=0,c=0;
int x,sum;
cout<<"方程 a*x^2 + b*x + c = y 的解是: "<<endl;
ofile<<"方程 a*x^2 + b*x + c = y 的解是: "<<endl;
for(a=1;a<y2;a++){
for(b=0;b<y2;b++){
for(c=0;c<y2;c&#