Page 1 of 4 123 ... LastLast
Results 1 to 25 of 89

Thread: ++

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User DeViL12's Avatar
    Join Date: Oct:2006
    Location:
    Posts: 1,807

    ++

    ++ :
    #include <cstdlib>
    #include <iostream>
    using namespace std;
    int r, S; P;
    int f()
    {
    S=2*r*r;
    P=2 * 3,14 * r;
    cout<< "S= " << S;
    cout<< "\n";
    cout<< "P= " << P;
    cout<< "\n";
    cout<< "\n";
    cout<< "\n";
    }
    int main(int argc, char *argv[])
    {
    cout<< "Enter value for radius: ";
    cin>> r;
    cout<< "\n";
    f();
    system("PAUSE");
    return EXIT_SUCCESS;
    }
    , =3,14, r*r, r , .
    ASrock B75-Pro3/i5-3770 3.4GHz/Corsair Vengance 24GB DDR3-1600/GB GTX 1060 6GB/CM GX-Lite 500W/DELL U2312HM

  2. #2
    Exhumator's Avatar
    Join Date: Jan:2005
    Location: Sofia
    Posts: 14,687
    "3.14" .

  3. #3
    Registered User DeViL12's Avatar
    Join Date: Oct:2006
    Location:
    Posts: 1,807
    . . .

    edit: , 2 , .
    Last edited by DeViL12; 13th February 2008 at 23:04.
    ASrock B75-Pro3/i5-3770 3.4GHz/Corsair Vengance 24GB DDR3-1600/GB GTX 1060 6GB/CM GX-Lite 500W/DELL U2312HM

  4. #4
    Exhumator's Avatar
    Join Date: Jan:2005
    Location: Sofia
    Posts: 14,687
    "3.14f" - f .

  5. #5
    Registered User vegasis's Avatar
    Join Date: Jun:2005
    Location:
    Posts: 1,156
    float, int
    pow (r,2) (math.h)

  6. #6
    Registered User DeViL12's Avatar
    Join Date: Oct:2006
    Location:
    Posts: 1,807
    , . P ka :"int double P" ?
    ASrock B75-Pro3/i5-3770 3.4GHz/Corsair Vengance 24GB DDR3-1600/GB GTX 1060 6GB/CM GX-Lite 500W/DELL U2312HM

  7. #7
    Registered User DeViL12's Avatar
    Join Date: Oct:2006
    Location:
    Posts: 1,807
    :float double P; ? . r , 4 :
    #include <cstdlib>
    #include <iostream>
    #include <math.h>
    using namespace std;
    int r, P, S;

    int f()
    {
    S=2*(r,2);
    P=2*3.14f*r;
    cout<< "S= " << S;
    cout<< "\n";
    cout<< "P= " << P;
    cout<< "\n";
    cout<< "\n";
    cout<< "\n";
    }
    int main(int argc, char *argv[])
    {
    cout<< "Enter value for radius: ";
    cin>> r;
    cout<< "\n";
    f();
    system("PAUSE");
    return EXIT_SUCCESS;
    }
    ASrock B75-Pro3/i5-3770 3.4GHz/Corsair Vengance 24GB DDR3-1600/GB GTX 1060 6GB/CM GX-Lite 500W/DELL U2312HM

  8. #8
    Registered User vegasis's Avatar
    Join Date: Jun:2005
    Location:
    Posts: 1,156
    , float, float double.

  9. #9
    Registered User DeViL12's Avatar
    Join Date: Oct:2006
    Location:
    Posts: 1,807
    ++ sorry
    float , 2 .
    ASrock B75-Pro3/i5-3770 3.4GHz/Corsair Vengance 24GB DDR3-1600/GB GTX 1060 6GB/CM GX-Lite 500W/DELL U2312HM

  10. #10
    Registered User vegasis's Avatar
    Join Date: Jun:2005
    Location:
    Posts: 1,156
    #include <math.h>

    cout<< "S= " << 2*powf (r, 2);

  11. #11
    Registered User DeViL12's Avatar
    Join Date: Oct:2006
    Location:
    Posts: 1,807
    4 .
    ASrock B75-Pro3/i5-3770 3.4GHz/Corsair Vengance 24GB DDR3-1600/GB GTX 1060 6GB/CM GX-Lite 500W/DELL U2312HM

  12. #12
    Registered User vegasis's Avatar
    Join Date: Jun:2005
    Location:
    Posts: 1,156
    :
    S=2*(r,2);

  13. #13
    Registered User DeViL12's Avatar
    Join Date: Oct:2006
    Location:
    Posts: 1,807
    , r , 4 .
    ASrock B75-Pro3/i5-3770 3.4GHz/Corsair Vengance 24GB DDR3-1600/GB GTX 1060 6GB/CM GX-Lite 500W/DELL U2312HM

  14. #14
    Registered User vegasis's Avatar
    Join Date: Jun:2005
    Location:
    Posts: 1,156
    ...

    f() , int void f() {....}
    3.14f 3,14

  15. #15
    Registered User DeViL12's Avatar
    Join Date: Oct:2006
    Location:
    Posts: 1,807
    :
    #include <cstdlib>
    #include <iostream>
    #include <math.h>
    using namespace std;
    int r, S;
    float P;
    const float pi=3.14;

    void f()
    {
    S=2*(r,2);
    P=2*pi*r;
    cout<< "S= " << S;
    cout<< "\n";
    cout<< "P= " << P;
    cout<< "\n";
    cout<< "\n";
    cout<< "\n";
    }
    int main(int argc, char *argv[])
    {
    cout<< "Enter value for radius: ";
    cin>> r;
    cout<< "\n";
    f();
    system("PAUSE");
    return EXIT_SUCCESS;
    }
    ASrock B75-Pro3/i5-3770 3.4GHz/Corsair Vengance 24GB DDR3-1600/GB GTX 1060 6GB/CM GX-Lite 500W/DELL U2312HM

  16. #16
    Registered User vegasis's Avatar
    Join Date: Jun:2005
    Location:
    Posts: 1,156
    , :

    #include <cstdlib>
    #include <iostream>
    #include <math.h>
    using namespace std;
    int r, P, S;

    void f()
    {
    S=2*powf(r,2);
    P=2*3,14*r;
    cout<< "S= " << S;
    cout<< "\n";
    cout<< "P= " << P;
    cout<< "\n";
    cout<< "\n";
    cout<< "\n";
    }
    int main(int argc, char *argv[])
    {
    cout<< "Enter value for radius: ";
    cin>> r;
    cout<< "\n";
    f();
    system("PAUSE");
    return EXIT_SUCCESS;
    }

  17. #17
    Registered User DeViL12's Avatar
    Join Date: Oct:2006
    Location:
    Posts: 1,807
    . !
    ASrock B75-Pro3/i5-3770 3.4GHz/Corsair Vengance 24GB DDR3-1600/GB GTX 1060 6GB/CM GX-Lite 500W/DELL U2312HM

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

  19. #19
    Pesho's Avatar
    Join Date: Nov:2001
    Location: Sofia
    Posts: 5,169
    Quote Originally Posted by icaci View Post
    - ( -), .

    :


    Code:
    template <class T>
    T sqr(const T& value) { return value * value; }

  20. #20
    ɐ-əpoɔᴉu⋂ ɐ ə anrieff's Avatar
    Join Date: Apr:2004
    Location: Sofia
    Posts: 8,448


    Code:
    #define sqr(x) ((x)*(x))
    , . .
    "640K ught to be enough for anybody" - Bill Gates, 1981
    ::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel

  21. #21
    Pesho's Avatar
    Join Date: Nov:2001
    Location: Sofia
    Posts: 5,169
    Quote Originally Posted by anrieff View Post


    Code:
    #define sqr(x) ((x)*(x))

    ...
    Code:
    sqr(++x)
    ( )
    Last edited by Pesho; 14th February 2008 at 02:44.

  22. #22
    ɐ-əpoɔᴉu⋂ ɐ ə anrieff's Avatar
    Join Date: Apr:2004
    Location: Sofia
    Posts: 8,448
    Quote Originally Posted by Pesho View Post
    ...
    Code:
    sqr(++x)
    ( )
    , ?
    , . .
    "640K ught to be enough for anybody" - Bill Gates, 1981
    ::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel

  23. #23
    Registered User
    Join Date: Dec:2007
    Location:
    Posts: 655
    Quote Originally Posted by anrieff View Post
    , ?
    , "C++" , , , inline . "C" "C99" ...

    DeViL12, "#include <math.h>" "#include <cmath>", . "using namespace std;" , ...

  24. #24
    Pesho's Avatar
    Join Date: Nov:2001
    Location: Sofia
    Posts: 5,169
    @anrieff, . template , 20 ( 2008-), . , C/C++ ( ) .


    Quote Originally Posted by AK-85 View Post
    "using namespace std;" , ...

    "using namespace std;" . .cpp- .

  25. #25
    Registered User vegasis's Avatar
    Join Date: Jun:2005
    Location:
    Posts: 1,156
    Quote Originally Posted by AK-85 View Post
    "#include <math.h>" "#include <cmath>", . "using namespace std;" , ...
    cmath namespace std, math - global namespace, using namespace std , - .

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 |