Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
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.
sorting
ReplaceGreaterSum in BST
Kishan_Basic_Geometry
TemplateBinTree
Matrix rotation
isBST
snake logic complete c++
Kth Smallest Element (with extra space)
Test 5(2020)
scuba
Please log in to post a comment.