Results 1 to 13 of 13

Thread: ++

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    . haibusa2005's Avatar
    Join Date: Mar:2005
    Location:
    Posts: 1,884

    ++

    , 3D . , Bloodshed Dev-C++. . , ax^2+-bx+-c=0. , . =9, b=-6, c=1, , 1/3 ( ), 27, . :

    Code:
    #include<iostream>
    #include<cmath>
    using namespace std;
    #include<stdio.h>
    
    int main(void)
    {
        float A, B, C, D, X, X1, X2;
        cout << "Enter the A, B, C parameters of the quadratic equation\n";
        cout << "A=";
        cin >> A;
        cout << "B=";
        cin >> B;
        cout << "C=";
        cin >> C;
        D=(B*B)-(4*A*C);
        cout << "The discriminant is " <<D <<"\n";
        if(D>0)
    {
        X1=(-B+sqrt(D))/(2*A);
        X2=(-B-sqrt(D))/(2*A);
        cout << "X1=" << X1;
        cout << "\nX2=" << X2 <<"\n";
    }
        if(D<0){cout << "The equation doesn't have real radicals.\n";}
        if(D==0)
    {
        X=(-B)/2*A;
        cout <<"X1=X2=" << X << "\n";
    }
        system("pause");
        return 0;
    }

  2. #2
    philosophus duratea icaci's Avatar
    Join Date: Oct:2006
    Location: Aachen
    Posts: 2,698
    Quote Originally Posted by haibusa2005 View Post
    ... , ax^2+-bx+-c=0. , . =9, b=-6, c=1, , 1/3 ( ), 27, ...
    cout . , , . :
    Code:
    X=(-B)/2*A;
    C/C++ ,
    Code:
    X=-B/(2.0*A);
    Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others

  3. #3
    . haibusa2005's Avatar
    Join Date: Mar:2005
    Location:
    Posts: 1,884
    , . , 27, 0.33333333 , float, . - , , .
    Last edited by haibusa2005; 22nd June 2007 at 08:04.

  4. #4
    philosophus duratea icaci's Avatar
    Join Date: Oct:2006
    Location: Aachen
    Posts: 2,698
    , #2,
    Code:
    $ ./mtest
    Enter the A, B, C parameters of the quadratic equation
    A=9
    B=-6
    C=1
    The discriminant is 0
    X1=X2=0.333333
    Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others

  5. #5
    . haibusa2005's Avatar
    Join Date: Mar:2005
    Location:
    Posts: 1,884
    , . 2.0 , . , icaci!

  6. #6
    ++/# php_bg's Avatar
    Join Date: Jun:2007
    Location: Here
    Posts: 47
    , :

    #include<cmath>

    #include<stdio.h>?
    cmath, ...
    math?
    int main(void) ?
    btw, ... , ++...
    - - #include<iostream>
    20 ++ ( )

  7. #7
    philosophus duratea icaci's Avatar
    Join Date: Oct:2006
    Location: Aachen
    Posts: 2,698
    cmath math.h, std. C (stdio.h, math.h ..) C++ "", c . / std, , .
    main void , . main() - ( C void, ). int, g++ , .
    stdio.h
    Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others

  8. #8
    . haibusa2005's Avatar
    Join Date: Mar:2005
    Location:
    Posts: 1,884
    stdio.h system("pause"), . cmath sqrt(float __x)

  9. #9
    ++/# php_bg's Avatar
    Join Date: Jun:2007
    Location: Here
    Posts: 47
    System ("Pause"); stdio.h (, - ++... )
    sqrt ... ...
    - , (, ... ), , 2 2 ...

    ..: , :
    - ( ) cin, , ...

  10. #10
    philosophus duratea icaci's Avatar
    Join Date: Oct:2006
    Location: Aachen
    Posts: 2,698
    , system(3) stdlib.h. , cstdlib
    Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others

  11. #11
    ++/# php_bg's Avatar
    Join Date: Jun:2007
    Location: Here
    Posts: 47
    System(3) ?
    ?

  12. #12
    philosophus duratea icaci's Avatar
    Join Date: Oct:2006
    Location: Aachen
    Posts: 2,698
    , 3 man - .
    Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others

  13. #13
    ++/# php_bg's Avatar
    Join Date: Jun:2007
    Location: Here
    Posts: 47
    , ...
    ...
    .
    Last edited by php_bg; 27th June 2007 at 17:26.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |