задачка в Си

Discussion in 'Болталка' started by XaKeR-SpAm, 1 Nov 2011.

  1. XaKeR-SpAm

    XaKeR-SpAm New Member

    Joined:
    18 Jun 2009
    Messages:
    17
    Likes Received:
    2
    Reputations:
    0
    delete

    delete
     
    #1 XaKeR-SpAm, 1 Nov 2011
    Last edited: 1 Nov 2011
  2. Шухер

    Шухер New Member

    Joined:
    13 Dec 2009
    Messages:
    10
    Likes Received:
    1
    Reputations:
    0
    где-то ошибка стопудов.
     
  3. XaKeR-SpAm

    XaKeR-SpAm New Member

    Joined:
    18 Jun 2009
    Messages:
    17
    Likes Received:
    2
    Reputations:
    0
    delete
     
    #3 XaKeR-SpAm, 1 Nov 2011
    Last edited: 1 Nov 2011
  4. Шухер

    Шухер New Member

    Joined:
    13 Dec 2009
    Messages:
    10
    Likes Received:
    1
    Reputations:
    0
    стараться нужно и все получится!
     
  5. XaKeR-SpAm

    XaKeR-SpAm New Member

    Joined:
    18 Jun 2009
    Messages:
    17
    Likes Received:
    2
    Reputations:
    0
    стараюсь мучаюсь, да и времени катострофически не хватает... 7 подобных задач есть... те почти решил там проще а эта запарна как то
     
  6. St0nX

    St0nX Elder - Старейшина

    Joined:
    19 May 2007
    Messages:
    257
    Likes Received:
    46
    Reputations:
    0
    На пары надо ходить, а не пиво жрать и спать
     
  7. awdrg

    awdrg Member

    Joined:
    30 Jan 2009
    Messages:
    195
    Likes Received:
    31
    Reputations:
    1
    Code:
    #include <cmath>
    cin >> n >> x;
    int Sum = 0;
    for(int i = 0; i < n; i++)
       Sum += 1/pow(x,2*i+1)*(2*i+1);
    Sum *= 2;
    cout << Sum;
    
    лаба проще некуда
     
    #7 awdrg, 1 Nov 2011
    Last edited: 1 Nov 2011
  8. XaKeR-SpAm

    XaKeR-SpAm New Member

    Joined:
    18 Jun 2009
    Messages:
    17
    Likes Received:
    2
    Reputations:
    0
    не так... там единица делить на всё... и ноль надо отдельно вывести
     
  9. awdrg

    awdrg Member

    Joined:
    30 Jan 2009
    Messages:
    195
    Likes Received:
    31
    Reputations:
    1
    чертова невнимательность, исправил