Create 1872.cpp

pull/45/head
Kirigaya Kazuto 2016-10-24 17:25:55 +08:00 committed by GitHub
parent 4da9cf8ad5
commit 8cd4070236
1 changed files with 16 additions and 0 deletions

16
QUSTOJ/1872.cpp Normal file
View File

@ -0,0 +1,16 @@
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
int x=(-b+sqrt(b*b-4*a*c))/2*a;
int y=(-b-sqrt(b*b-4*a*c))/2*a;
if(x<y) swap(x,y);
cout<<x;
if(y!=x) cout<<" "<<y;
cout<<endl;
return 0;
}