Results 1 to 14 of 14

Thread: ++

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Mar:2010
    Location: Sofia
    Posts: 73

    ++

    . . ?
    :

    .
    abs, labs, fabs
    int, long, double, ceil, floor
    ,
    sqrt pow
    .
    ( <cstdlib>
    <cmath>), .



    #include<iostream.h>
    #include<cstdlib>
    #include<cmath>
    using namespace std;
    int main ()
    {
    int m=5, n=-7;
    long k=5, l=-7;
    double x=5.2, y=-7.7;
    double a=-5.2, b=7.7;
    cout<<"Absolute value functions"<<endl;
    cout<<"|m|="<<abs(m)<< endl //cstdlib
    <<"|n|="<<abs(n)<< endl;
    cout<<"|k|="<<labs(k)<< endl //cstdlib
    <<"|l|="<<labs(l)<< endl;
    cout<<"|x|="<<fabs(x)<< endl //cmath
    <<"|y|="<<fabs(y)<< endl<<endl;
    cout<<"ceil function - round up <cmath>"<< endl;
    cout<<"ceil(5.2) ="<<ceil(5.2)<< endl;
    cout<<"ceil(-7.7)="<<ceil(-7.7)<< endl;
    cout<<"ceil(-5.2)="<<ceil(-5.2)<< endl;
    cout<<"ceil(7.7)="<<ceil(7.7)<< endl<<endl;
    cout<<"floor function - round down <cmath>"<< endl;
    cout<<"floor(5.2) ="<<floor(5.2)<< endl;
    cout<<"floor(-7.7)="<<floor(-7.7)<< endl;
    cout<<"floor(-5.2)="<<floor(-5.2)<< endl;
    cout<<"floor(7.7)="<<floor(7.7)<< endl<<endl;
    cout<<"sqrt function <cmath>" << endl;
    cout<<"sqrt (16)= "<<sqrt(16) <<endl;
    cout<<"sqrt (16.0)="<<sqrt (16.0) <<endl<<endl;
    cout<<"pow function <cmath>" endl;
    cout<<"pow(5.2,3)="<<pow(5.2,3)<< endl;
    cout<<"pow(-5.2,3.0)="<<pow(-5.2,3.0)<< endl;
    cout<<"pow(5.2,-3)="<<pow(5.2,-3)<< endl;
    cout<<"pow(-5.2,-3.0)="<<pow(-5.2,-3.0)<< endl;
    double z=pow(sqrt(4),2) + sqrt(pow(2,4))<< endl;
    cout<<"z="<<z<< endl;
    return 0;
    }


    6. C++, :
    ) a , a;
    ) , p.
    . , ++ , a,b,c.(, )

  2. #2
    Registered User
    Join Date: Oct:2003
    Location:
    Posts: 4,317
    6. . C++.

  3. #3
    Registered User
    Join Date: Mar:2010
    Location: Sofia
    Posts: 73
    Quote Originally Posted by bsb View Post
    6. . C++.

  4. #4
    Street Racer Rain9333's Avatar
    Join Date: Feb:2007
    Location: Bg, Gb
    Posts: 824
    -> p = (sqrt(a))*4 ; ?
    MSI X570-A PRO, AMD 5800X3D, Noctua NH-D15, Corsair Vengeance LPX 2x8GB-3600, ASUS RTX ROG 3080 Strix White OC, Samsung 980 Pro 1TB NVMe, Corsair RM750, FD Define R5, Dell 32" 4k G3223Q 144Hz + 3xSamsung G5 32" 144hz, SimLab P1-X, Simucube 2 Pro, HE Ultimate, SRB GT3 Wheel

  5. #5
    Registered User vekatatd's Avatar
    Join Date: Apr:2007
    Location: sofia
    Posts: 293
    Quote Originally Posted by Rain9333 View Post
    -> p = (sqrt(a))*4 ; ?
    s=(sqr(p))/(12*sqrt(3)) C++ s=p^2/(12*3^0,5)

  6. #6
    . haibusa2005's Avatar
    Join Date: Mar:2005
    Location:
    Posts: 1,884
    . : S=(P/6)*sqrt(((p/3)^2)-((p/6)^2))

  7. #7
    Registered User vekatatd's Avatar
    Join Date: Apr:2007
    Location: sofia
    Posts: 293
    Quote Originally Posted by haibusa2005 View Post
    . : S=(P/6)*sqrt(((p/3)^2)-((p/6)^2))
    , , , - 3 ,

  8. #8
    . haibusa2005's Avatar
    Join Date: Mar:2005
    Location:
    Posts: 1,884
    Quote Originally Posted by vekatatd View Post
    , , , - 3 ,
    , 27 , 0.25 ^2, 34.074 ^2, .

  9. #9
    Registered User
    Join Date: Mar:2010
    Location: Sofia
    Posts: 73
    ) p = (sqrt(a))*4, ) s=(sqr(p))/(12*sqrt(3)) S=(P/6)*sqrt(((p/3)^2)-((p/6)^2)) ?

  10. #10
    Registered User
    Join Date: Oct:2003
    Location:
    Posts: 4,317
    C++ . .

  11. #11
    Registered User
    Join Date: Oct:2003
    Location:
    Posts: 4,317
    - sqr , , sqrt. , "". , ( 3)/2,
    , , , ( 3) - , .

    - - . , , , " " ( 3) , .
    Last edited by bsb; 28th March 2010 at 11:15.

  12. #12
    . haibusa2005's Avatar
    Join Date: Mar:2005
    Location:
    Posts: 1,884
    . . . sqrt(((P/6)^3)*(P/2))
    Last edited by haibusa2005; 27th March 2010 at 13:34.

  13. #13
    Registered User
    Join Date: Mar:2010
    Location: Sofia
    Posts: 73
    , ) )

  14. #14
    Pesho's Avatar
    Join Date: Nov:2001
    Location: Sofia
    Posts: 5,169
    Quote Originally Posted by ludden View Post
    , ) )
    http://hardwarebg.com/forum/showthread.php?t=104353
    , !

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 |