Strona główna > C++, Ciągi, Rekurencja > Ciąg arytmetyczny (rekurencyjnie)

Ciąg arytmetyczny (rekurencyjnie)

22 listopada 2009 Dodaj komentarz Go to comments
//n - ty wyraz ciagu arytmetycznego rekurencyjnie
# include <iostream>
using namespace std;
long int c_a(int n, int a, int r);
int a,r,n,k;
int main ()
    cout<<"Podaj a: "; cin>>a;
    cout<<"Podaj r : "; cin>>r;
    cout<<"Ktory wyaraz wyznaczyc?  "; cin>>n;
    cout<<n<<" - wyraz ciagu arytmetycznego = "<<c_a(n,a,r)<<endl;
    cout<<"Ile wyrazow wypisac?  "; cin>>k;
    for (int i=1; i<=k; i++)
    cout<<i<<" = "<<c_a(i,a,r)<<endl;
    return 0;
long int c_a(int n, int a, int r)
     if (n==1)
     return a;
     return c_a(n-1,a,r)+r;

Kategorie:C++, Ciągi, Rekurencja Tagi: ,
  1. 15 grudnia 2012 o 8:55 pm

    Thanks for sharing your thoughts. I really appreciate your efforts and I am waiting for your
    next write ups thank you once again.

  2. 27 sierpnia 2013 o 6:46 pm

    I have read some good stuff here. Definitely worth bookmarking for revisiting.

    I wonder how so much attempt you place to make any such great informative website.

  3. 14 Maj 2014 o 3:34 pm

    Everyone loves what you guys are usually up too.
    This sort of clever work and exposure! Keep up the superb works guys
    I’ve included you guys to my blogroll.

  4. 13 czerwca 2014 o 1:07 am

    On their first mission, they brought back live chickens and ducks which they had captured.
    During gameplay you also can choose different weapons depending on the ones
    you have unlocked during the campaign so you get additional customization the further into the
    game you get. Three types of Titans have been announced so far,
    and each of them possesses different characteristics.

  5. 13 sierpnia 2014 o 1:49 am

    It’s remarkable to visit this web page and reading the views of all colleagues concerning this post, while I am also keen of
    getting knowledge.

  6. 23 października 2014 o 10:36 am

    If some one desires expert view concerning running a blog afterward i suggest him/her to pay a visit this blog, Keep up the pleasant work.

  7. 23 listopada 2014 o 12:33 am

    Hello everyone, it’s my first pay a visit at this web site, and piece
    of writing is truly fruitful in support of me, keep up posting these types of articles.

  8. 23 listopada 2014 o 10:39 pm

    I’m impressed, I must say. Rarely do I come across a blog that’s both educative
    andd entertaining, and without a doubt, you have hit the nail oon the head.
    Thee problem is something not enough people are speaking inteligently
    about. Now i’m very happy that I came across this in mmy hunt
    forr something concerning this.

  9. 12 stycznia 2015 o 8:43 am

    Hi there colleagues, how is all, and what you wish for to say regarding this paragraph, in my view its really awesome
    designed for me.

  10. 17 stycznia 2015 o 10:33 am

    Based mostly strictly on the efficiency data from each webhost, there have
    been three hosts that basically stood out within the

  11. 10 lutego 2015 o 6:17 am

    Merci grandement pour vos ressources !

  12. 16 marca 2015 o 9:22 am

    hi!,I love your writing so a lot! share we keep up a correspondence more approximately your article on AOL?
    I need a specialist on this house to resolve my problem.
    Maybe that’s you! Taking a look forward to peer you.

  13. 25 sierpnia 2015 o 11:31 am

    Admiring the commitment you put into your blog and detailed information you provide.
    It’s awesome to come across a blog every once in a while that isn’t
    the same out of date rehashed information. Great read! I’ve
    saved your site and I’m including your RSS feeds to my Google account.

  14. 27 listopada 2016 o 11:09 am

    Thank you for the auspicious writeup. It in fact was once a
    enjoyment account it. Glance advanced to far brought agreeable from you!
    However, how can we be in contact?

  15. 20 lipca 2017 o 4:03 pm

    Asking questions are actually nice thing if you are not understanding something
    totally, but this paragraph gives good understanding even.

  16. 30 sierpnia 2017 o 9:28 am

    Hi there, afte reading this remarkable piece oof writing
    i am t᧐o cheerful to share mʏ experience here ѡith mates.

  1. 24 Maj 2015 o 2:05 am
  2. 9 lipca 2017 o 11:15 am


Wprowadź swoje dane lub kliknij jedną z tych ikon, aby się zalogować:


Komentujesz korzystając z konta Wyloguj /  Zmień )

Zdjęcie na Google+

Komentujesz korzystając z konta Google+. Wyloguj /  Zmień )

Zdjęcie z Twittera

Komentujesz korzystając z konta Twitter. Wyloguj /  Zmień )

Zdjęcie na Facebooku

Komentujesz korzystając z konta Facebook. Wyloguj /  Zmień )


Connecting to %s

%d blogerów lubi to: