Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Example program
- #include <iostream>
- #include <string>
- #include <cmath>
- using namespace std;
- int main(){
- int A, B, C, D;
- cin>>A>>B>>C;
- D=B*B-4*A*C;
- if(D<0){
- cout<<"No roots";
- }
- else{
- if(D==0){
- cout<<-B/(2*A);
- }
- else{
- cout<<(-B-sqrt(D))/(2*A)<<"; "<<(-B+sqrt(D))/(2*A);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement