#include<iostream> #include<cmath> #include<cstdio> using namespace std; int main() { int a, b, c; scanf_s("%d %d %d", &a, &b, &c); double x,y1,y2; x = sqrt(b*b - 4*a*c); y1 = (-b + x) / (2 * a); y2 = (-b - x) / (2 * a); printf("%.2f,%.2f", y1, y2); return 0; } /* Main.cc: In function 'int main()': Main.cc:8:32: error: 'scanf_s' was not declared in this scope scanf_s("%d %d %d", &a, &b, &c); ^ */ |
Double click to view unformatted code.