fork download
  1. #include <fstream>
  2. #include <cmath>
  3. using namespace std;
  4. int main()
  5. {
  6. double a,b,c,x1,x2;
  7. ifstream cin("input.txt");
  8. cin>>a>>b>>c;
  9. a!=0;
  10. (b*b-4*a*c)>=0;
  11. x1=(-1*b+sqrt(b*b - 4*a*c))/(2*a);
  12. cout<<"x1="<<x1;
  13. x2=(-1*b-sqrt(b*b-4*a*c))/(2*a);
  14. cout<<"x2="<<x2;
  15. ofstream cout("output.txt");
  16. cout<<fixed;
  17. cout.precision(3);
  18. cout<<x1<<x2;
  19. return 0;
  20. }
  21.  
  22.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:12:5: error: ‘cout’ was not declared in this scope
     cout<<"x1="<<x1;
     ^~~~
prog.cpp:12:5: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
prog.cpp:3:1:
+#include <iostream>
 using namespace std;
prog.cpp:12:5:
     cout<<"x1="<<x1;
     ^~~~
stdout
Standard output is empty