Results 1 to 3 of 3

Thread: c++

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Hard Core Gaming HardDrive's Avatar
    Join Date: Jun:2006
    Location:
    Posts: 754

    c++

    :
    1/1! + 1/2! + 1/3! +....+ 1/n!
    #include<iostream>
    using namespace std;

    int main()
    {
    double Suma=0;
    double Chislo;
    int n;
    int x=1;
    cout<<"Vyvedete n:";cin>>n;
    for(int i=1; i<=n; i++)
    {x=x*i; Chislo=1.0/x; Suma+=Chislo;}

    cout<<"Rezultat: "<<Suma<<endl;
    system ("pause");
    return 0;
    }
    To , . .
    Config: Ryzen 3700x / Gigabyte x570 Gaming X / RX480 Strix 1400@2250 / 2x8gb Corsair Vengeance / Seagate Barracuda 1Tb + 256gb OCZ Trion / SuperFlower Leadex II Gold 750w / BeQuiet B801 / LG 23MA53 + Philips 170c / Logitech G502 / CM QuickFire TK

    Acer Predator G9-593 I7 7700HQ + GTX1070

  2. #2
    ɐ-əpoɔᴉu⋂ ɐ ə anrieff's Avatar
    Join Date: Apr:2004
    Location: Sofia
    Posts: 8,448
    double 'x'. int n=13.
    , . .
    "640K ught to be enough for anybody" - Bill Gates, 1981
    ::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel

  3. #3
    Hard Core Gaming HardDrive's Avatar
    Join Date: Jun:2006
    Location:
    Posts: 754
    .
    Config: Ryzen 3700x / Gigabyte x570 Gaming X / RX480 Strix 1400@2250 / 2x8gb Corsair Vengeance / Seagate Barracuda 1Tb + 256gb OCZ Trion / SuperFlower Leadex II Gold 750w / BeQuiet B801 / LG 23MA53 + Philips 170c / Logitech G502 / CM QuickFire TK

    Acer Predator G9-593 I7 7700HQ + GTX1070

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 |