Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
test
ф#include <iostream> #include <string> #include <cmath> #include <strings.h> using namespace std; int main(int argc , char* argv[]) { cout << "made by god" << endl << endl; double a,b,c,discr,answer,x1,x2; //cout << "enter a,b,c"; cout << endl; //cin >> a >> b >> c ; cout << endl; string temp; temp = argv[1];a = stod(temp); // set a temp = argv[2];b = stod(temp); // set b temp = argv[3];c = stod(temp); // set c discr = b*b - 4*a*c; if(discr < 0){ cout << "there are no soulves " << endl;return -1;} else if(discr == 0) { answer = ((-1*b)/(2*a)); cout << "answer is " << answer << endl; return 1; } else { x1 = ((-1 * b) + sqrt(discr)) / 2*a; x2 = ((-1 * b) - sqrt(discr)) / 2*a; cout << "answers are" << endl << "x1 = " << x1 << endl << "x2 = " << x2 << endl; } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Romberg Integration
Вывод элементов массива
major element
infix to postfix v 6.0 - (exponent support + multiple digits)
AWE
sd
integerDivision
1st
Dar
DSU on tree (http://codeforces.com/contest/600/problem/E)
Please log in to post a comment.