Results 1 to 18 of 18

Thread: ++

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User ScrollRoll's Avatar
    Join Date: Nov:2006
    Location: Pomorie
    Posts: 7

    ++


    :

    - (f1=f2=1, fn=fn-1+fn-2) N , / N /

    :
    #include<iostream.h>
    void main ()
    {
    int a[1000],n,Max;
    a[1]=1;
    a[2]=1;
    for(int i=3;i<=1000;i++) a[i]=a[i-1]+a[i-2];
    cout<<"vyvedete n"; cin>>n;
    for(i=1;1<=1000;i++)
    {
    if(n>=a[i]) Max=a[i]
    else break;
    }
    cout<<Max;
    }
    ... ( ++ )

  2. #2
    Pesho's Avatar
    Join Date: Nov:2001
    Location: Sofia
    Posts: 5,169
    . , , 1) int , 2) i - .

    , ?

  3. #3
    Banned
    Join Date: Oct:2001
    Location: , -5
    Posts: 2,637
    Quote Originally Posted by Pesho View Post
    2) i -
    ? C99 . gcc -cc99 gcc -gnu99 . C , C++ , ?

  4. #4
    Pesho's Avatar
    Join Date: Nov:2001
    Location: Sofia
    Posts: 5,169
    Quote Originally Posted by exabyte View Post
    ? C99 . gcc -cc99 gcc -gnu99 . C , C++ , ?

    C++ , C99?

    C++03 , for(...), . Once upon a time C99, -. default , warnings.
    , !

  5. #5
    Registered User ScrollRoll's Avatar
    Join Date: Nov:2006
    Location: Pomorie
    Posts: 7
    Dev C++ ili Borland C++. Dev C++ .

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

    , Max=a[i]. fellix .

  7. #7
       
    Join Date: Aug:2003
    Location:  
    Posts: 8,103
    Code:
    #include<iostream.h>
    
    int main(void)
    {
     int a[1000], n, Max, i;
     a[1]=1;
     a[2]=1;
    for(i=3; i<=1000; i++) a[i]=a[i-1]+a[i-2];
     cout << "vyvedete n: "; 
     cin >> n;
    for(i=1; 1<=1000; i++) 
    { 
     if(n>=a[i]) Max=a[i];
     else break;
    }
    cout <<"\n"<< Max; cout <<"\n\n";
    
    system("PAUSE");
    return 0;
    }
    .
    ASRock X99 Extreme6/3.1 | Core i7 6950X | 32GB G.Skill DDR4-3200 | Samsung 970 PRO 1TB | MSI GeForce RTX 4080 Gaming X Trio

  8. #8
    Registered User ScrollRoll's Avatar
    Join Date: Nov:2006
    Location: Pomorie
    Posts: 7
    !

  9. #9
    Defender Kaspirtov's Avatar
    Join Date: Jun:2006
    Location: Sf
    Posts: 7,414
    Quote Originally Posted by ScrollRoll View Post
    !
    ? ?
    for?
    for(i=1; 1<=1000; i++)
    .. n > a[1000] ...

    , ...
    " , , , , ."

  10. #10
    Registered User ScrollRoll's Avatar
    Join Date: Nov:2006
    Location: Pomorie
    Posts: 7
    for(i=1; 1<=1000; i++)
    "1" "i" .
    ? ?
    .

  11. #11
    Registered User
    Join Date: Oct:2003
    Location:
    Posts: 4,317
    , , . , 100 64- .
    - , - . , , C (signed int).

  12. #12
    Vesu's Avatar
    Join Date: May:2004
    Location: Zurich
    Posts: 1,319
    C/C++ ... .

  13. #13
    Whimmy Wham Wham Wozzle! lini's Avatar
    Join Date: Dec:2001
    Location: Wormulon
    Posts: 2,446
    ...

    Code:
    int main(void)
    {
     int  n, a,b,c;
     a=1;
     b=1;
     c=1;
     cout << "vyvedete n: "; 
     cin >> n;
     while ( n>=c)
     {
         c=a+b;
         a=b;
         b=c;
     }
    cout <<"\n"<< a <<"\n\n";
    return 0;
    }
    , N, () .

    99 little bugs in the code, 99 little bugs...
    Knock one down, and test it again, 100 little bugs in the cod...

  14. #14
    Registered User
    Join Date: Nov:2008
    Location: Bulgaria
    Posts: 68
    , ...

    :
    ++ , ..

    ...

    !!!!

  15. #15
    Defender Kaspirtov's Avatar
    Join Date: Jun:2006
    Location: Sf
    Posts: 7,414
    Quote Originally Posted by Savomir View Post
    , ...

    :
    ++ , ..

    ...

    !!!!
    ?!
    " , , , , ."

  16. #16
    Registered User
    Join Date: Nov:2008
    Location: Bulgaria
    Posts: 68
    Quote Originally Posted by Kaspirtov View Post
    ?!

    ...
    , ...

    Code:
    #include<iostream.h> 
    int main() 
    
    { 
        unsigned int n,a=0,b=0,c=1; 
        cout<<"n="; 
        cin>>n; 
        for(int i=1;i<=n;i++) 
        { 
              a=b; 
              b=c;        
              c=a+b;      
        } 
        cout<<c; 
        return 0; 
    
    }

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 |