Results 1 to 18 of 18
Thread: ++
Hybrid View
-
15th May 2007 23:33 #1
++

:
- (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;
}
)
-
15th May 2007 23:46 #2
-
11th March 2009 17:14 #3Banned
Join Date: Oct:2001
Location: , -5
Posts: 2,637
-
11th March 2009 17:41 #4
-
15th May 2007 23:50 #5
-
15th May 2007 23:56 #6
-
15th May 2007 23:52 #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
-
15th May 2007 23:57 #8
-
16th May 2007 17:11 #9
-
16th May 2007 20:30 #10for(i=1; 1<=1000; i++)
"1" "i" .
.? ?
-
16th May 2007 22:45 #11Registered User
Join Date: Oct:2003
Location:
Posts: 4,317
-
16th May 2007 23:03 #12
-
16th May 2007 23:35 #13
...
, N, () .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; }
99 little bugs in the code, 99 little bugs...
Knock one down, and test it again, 100 little bugs in the cod...
-
11th March 2009 17:10 #14Registered User
Join Date: Nov:2008
Location: Bulgaria
Posts: 68
, ...
:
++ , ..
...
!!!!
-
11th March 2009 18:23 #15
-
11th March 2009 18:39 #16Registered User
Join Date: Nov:2008
Location: Bulgaria
Posts: 68




Reply With Quote


Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in