herrDeng網內搜尋

自訂搜尋

Ads

2016年9月23日 星期五

ex3 C++陣列練習

請用C++11 array撰寫存費式數列的C++練習



Java版


42 則留言:

a10433015 提到...

#include <iostream>
#include <cstdlib>
#include <array>
using namespace std;

int main()
{
array<int, 40>x;
x[0] = x[1] = 1;
for (int i = 2; i < 40; i++)
{
x[i] = x[i - 1] + x[i - 2];
cout << i << "---" << x[i]<<endl;
}
system("Pause");
return 0;
}

A10433018 提到...

#include <iostream>
#include <cstdlib>
#include<array>
using namespace std;
int main()
{
array<int,40 >a;
a[0] = a[1] = 1;
for (int i = 2; i < 40; i++)
{
a[i] = a[i - 1] + a[i - 2];
cout << i << ">>>>>>>>>>>>>" << a[i] << endl;
}system("Pause");
return 0;
}

A10433036 提到...

#include
#include
#include
using namespace std;

int main()
{
arrayx;
x[0] = x[1] = 1;
for (int i = 2; i < 40; i++)
{
x[i] = x[i - 1] + x[i - 2];
cout << i << "---" << x[i] << endl;
}
system("Pause");
return 0;
}

A10433024 提到...

#include<iostream>
#include<cstdlib>
#include<array>
using namespace std;
int main()
{
array<int, 40>x;
x[0] = x[1] = 1;
for (int i = 2; i < 40; i++)
{
x[i] = x[i - 1] + x[i - 2];
cout << i << "---" << x[i] << endl;
}
system("pause");
return 0;
}

A10433021 提到...

#include
#include
#include
using namespace std;
int main()
{
arraya;
a[0] = a[1] = 1;
for (int i = 2; i < 40; i++)
{
a[i] = a[i - 1] + a[i - 2];
cout << i << ">>>>>>>>>>>>>" << a[i] << endl;
}system("Pause");
return 0;





}

A10433021 提到...

#include
#include
#include
using namespace std;
int main()
{
arraya;
a[0] = a[1] = 1;
for (int i = 2; i < 40; i++)
{
a[i] = a[i - 1] + a[i - 2];
cout << i << ">>>>>>>>>>>>>" << a[i] << endl;
}system("Pause");
return 0;





}

B10233082 唐偉強 提到...

#include
#include
using namespace std;
int main()
{
int a;
int b[45];
b[0] = 0;
b[1] = 1;

for (a = 2; a <= 45; a++)
{
b[a] = b[a - 1] + b[a - 2];
cout << b[a] << endl;
}
system("pause");

}

B10333054 提到...

#include<iostream>
#include<cstdlib>
#include<array>
using namespace std;
int main(){
int x[40];
x[0] = x[1] = 1;
for (int i = 2; i <40; i++){
x[i] = x[i - 1] + x[i - 2];
cout << i << "-->" << x[i]<<"\n";
}
system("pause");
return 0;
}

B10233074許逸憲 提到...

#include
#include
#include
using namespace std;
int main()
{
int a;
int b[45];
b[0] = 0;
b[1] = 1;

for (a = 2; a <= 45; a++)
{
b[a] = b[a - 1] + b[a - 2];
cout << b[a] << endl;
}
system("pause");

}

B10233073 楊博宇 提到...

#include
#include
#include
using namespace std;
int main()
{
int a;
int b[45];
b[0] = 0;
b[1] = 1;

for (a = 2; a <= 45; a++)
{
b[a] = b[a - 1] + b[a - 2];
cout << b[a] << endl;
}
system("pause");

}

B10233109 宋昱璋 提到...

#include
#include
#include
using namespace std;
int main()
{
int a;
int b[45];
b[0] = 0;
b[1] = 1;

for (a = 2; a <= 45; a++)
{
b[a] = b[a - 1] + b[a - 2];
cout << b[a] << endl;
}
system("pause");

}

B10233087 黃少洋 提到...

#include
#include
#include
using namespace std;
int main()
{
int a;
int b[45];
b[0] = 0;
b[1] = 1;

for (a = 2; a <= 45; a++)
{
b[a] = b[a - 1] + b[a - 2];
cout << b[a] << endl;
}
system("pause");

}

B10233102 羅時宇 提到...

#include
#include
#include
using namespace std;
int main()
{
int a;
int b[45];
b[0] = 0;
b[1] = 1;

for (a = 2; a <= 45; a++)
{
b[a] = b[a - 1] + b[a - 2];
cout << b[a] << endl;
}
system("pause");

}

B10233096 提到...

#include
#include
#include
using namespace std;
int main()
{
int a;
int b[45];
b[0] = 0;
b[1] = 1;

for (a = 2; a <= 45; a++)
{
b[a] = b[a - 1] + b[a - 2];
cout << b[a] << endl;
}
system("pause");

}

B10133186 提到...

#include <iostream>
#include <cstdlib>
#include <array>
using namespace std;
int main()
{
array<int,40> y;
y[0] = y[1] = 1;
for (int i = 2; i < 40; i++)
{
y[i] = y[i - 1] + y[i - 2];
cout << i << "-->" << y[i] << endl;
}
system("Pause");
return 0;
}

b10533065 提到...

#include <iostream>
#include <cstdlib>
using namespace std;
int main(void) {
int x[40];
x[0] = x[1] = 1;
for (int i = 2; i <40; i++){
x[i] = x[i - 1] + x[i -2];
cout << i << "-->" << x[i] << endl;
}
system("pause");
return 0;
}

b10533065 提到...

#include <iostream>
#include <cstdlib>
using namespace std;
int main(void) {
int x[40];
x[0] = x[1] = 1;
for (int i = 2; i <40; i++){
x[i] = x[i - 1] + x[i -2];
cout << i << "-->" << x[i] << endl;
}
system("pause");
return 0;
}

B10333016 提到...

#include <iostream>
#include <cstdlib>
#include <array>
using namespace std;
int main()
{
array<int, 20>x;
x[0] = x[1]=1;
for (int i = 2 ;i <20; i++){
x[i] = x[i-1] + x[i-2];
cout << i << "----->" << x[i] << "\n";
}
system("pause");
return 0;
}

B10233082 唐偉強 提到...

#include <iostream>
#include <cstdlib>
#include <array>
using namespace std;
int main()
{
int a;
int b[45];
b[0] = 0;
b[1] = 1;

for (a = 2; a <= 45; a++)
{
b[a] = b[a - 1] + b[a - 2];
cout << b[a] << endl;
}
system("pause");

}

A10433021 提到...

#include <iosteream>
#include <cstdlib>
#include <array>
using namespace std;
int main()
{
array<int, 40 >a;
a[0] = a[1] = 1;
for (int i = 2; i < 40; i++)
{
a[i] = a[i - 1] + a[i - 2];
cout << i << ">>>>>>>>>>>>>" << a[i] << endl;
}system("Pause");
return 0;

B10433103 提到...

#include <iostream>
#include <cstdlib>
#include <array>
using namespace std;

int main(){
array<_int64, 40>a;
a[0] = a[1] = 1;
for (int b = 2; b <40; b++){
a[b] = a[b-1] + a[b-2];
cout << b << "---->" << a[b] << endl;
}
system("pause");
return 0;
}

B10233127李昆和 提到...

#include <iostream>
#include <cstdlib>
#include <array>
using namespace std;
int main()
{
int a;
int b[45];
b[0]=0;
b[1]=1;
for(a=2;a<=45;a++)
{
b[a]=b[a-1]+b[a-2];
cout<<b[a]<<endl;
}
system("pause");
}

B10233074 許逸憲 提到...

#include <iostream>
#include <cstdlib>
#include <array>
using namespace std;
int main()
{
int a;
int b[45];
b[0] = 0;
b[1] = 1;

for (a = 2; a <= 45; a++)
{
b[a] = b[a - 1] + b[a - 2];
cout << b[a] << endl;
}
system("pause");

}

B10233073 楊博宇 提到...

#include <iostream>
#include <cstdlib>
#include <array>
using namespace std;
int main()
{
int a;
int b[45];
b[0] = 0;
b[1] = 1;

for (a = 2; a <= 45; a++)
{
b[a] = b[a - 1] + b[a - 2];
cout << b[a] << endl;
}
system("pause");

}

B10233109 宋昱璋 提到...

#include <iostream>
#include <cstdlib>
#include <array>
using namespace std;
int main()
{
int a;
int b[45];
b[0] = 0;
b[1] = 1;

for (a = 2; a <= 45; a++)
{
b[a] = b[a - 1] + b[a - 2];
cout << b[a] << endl;
}
system("pause");

}

B10233087 黃少洋 提到...

#include <iostream>
#include <cstdlib>
#include <array>
using namespace std;
int main()
{
int a;
int b[45];
b[0] = 0;
b[1] = 1;

for (a = 2; a <= 45; a++)
{
b[a] = b[a - 1] + b[a - 2];
cout << b[a] << endl;
}
system("pause");

}

B10233102 羅時宇 提到...

#include <iostream>
#include <cstdlib>
#include <array>
using namespace std;
int main()
{
int a;
int b[45];
b[0] = 0;
b[1] = 1;

for (a = 2; a <= 45; a++)
{
b[a] = b[a - 1] + b[a - 2];
cout << b[a] << endl;
}
system("pause");

}

B10233096 金綱儒 提到...

#include <iostream>
#include <cstdlib>
#include <array>
using namespace std;
int main()
{
int a;
int b[45];
b[0] = 0;
b[1] = 1;

for (a = 2; a <= 45; a++)
{
b[a] = b[a - 1] + b[a - 2];
cout << b[a] << endl;
}
system("pause");

}

B10433011 提到...

#include <iostream>
#include <cstdlib>
#include <array>
using namespace std;
int main()
{
array < long long, 40>x;
x[0] = x[1] = 1;
for (int i = 2; i < 40; i++)
{
x[i] = x[i - 1] + x[i - 2];
cout << i << "-->" << x[i] << "\n";
}
system("Pause");
return 0;
}

A10433021 提到...

#include <iosteream>
#include <cstdlib>
#include <array>
using namespace std;
int main()
{
array< long long, 100> x;
x[0] = x[1] = 1;
for (int i = 2; i < 100; i++)
{
x[i] = x[i - i] + x[i - 2];
cout << i << "--->" << x[i] << "\n";
}
system("pause");
return 0;
}

B10233108 林宣瑋 提到...

#include <iostream>
#include <cstdlib>
#include <array>
using namespace std;
int main()
{
array< _int64, 100>x;
x[0] = x[1] = 1;
for (int i = 2; i < 100; i++)
{
x[i] = x[i - 1] + x[i - 2];
cout << i << "--->" << x[i] << "\n";
}
system("pause");
return 0;
}

A10433021 提到...

#include <iosteream>
#include <cstdlib>
#include <array>
using namespace std;
int main()
{
array<int, 40 >a;
a[0] = a[1] = 1;
for (int i = 2; i < 40; i++)
{
a[i] = a[i - 1] + a[i - 2];
cout << i << ">>>>>>>>>>>>>" << a[i] << endl;
}system("Pause");
return 0;

A10433021 提到...

#include <iosteream>
#include <cstdlib>
#include <array>
using namespace std;
int main()
{
array< long long, 100> x;
x[0] = x[1] = 1;
for (int i = 2; i < 100; i++)
{
x[i] = x[i - i] + x[i - 2];
cout << i << "--->" << x[i] << "\n";
}
system("pause");
return 0;
}

B10333049 提到...

#include <iostream>
#include <cstdlib>
#include <array>
using namespace std;
int main(){
array<int,40>x;
x[0]=x[1]=1;
for(int i=2;i<40;i++){
x[i]=x[i-1]+x[i-2];
cout<<i<<"-->"<<x[i]<<"\n";
}
}

b10233137 提到...

#include <iostream>
#include <cstdlib>
#include <array>
using namespace std;
int main()
{
int a;
int b[45];
b[0]=0;
b[1]=1;
for(a=2;a<=45;a++)
{
b[a]=b[a-1]+b[a-2];
cout<<b[a]<<endl;
}
system("pause");
}

B1023 提到...

#include <iostream>
#include <cstdlib>
#include <array>
using namespace std;
int main()
{
int a;
int b[45];
b[0] = 0;
b[1] = 1;

for (a = 2; a <= 45; a++)
{
b[a] = b[a - 1] + b[a - 2];
cout << b[a] << endl;
}
system("pause");

}

B10233077 提到...

#include <iostream>
#include <cstdlib>
#include <array>
using namespace std;
int main()
{
int a;
int b[45];
b[0] = 0;
b[1] = 1;

for (a = 2; a <= 45; a++)
{
b[a] = b[a - 1] + b[a - 2];
cout << b[a] << endl;
}
system("pause");

}

B10433080 提到...

#include <iostream>
#include <cstdlib>
#include <array>
using namespace std;
int main()
{
array<_int64, 100>x;
x[0] = x[1] = 1;
for (int i = 2; i < 100; i++)
{
x[i] = x[i - 1] + x[i - 2];
cout << i << "-->" << x[i] << "\n";

}


system("pause");
return 0;
}

B10433092 提到...

#include <iostream>
#include <cstdlib>
#include <array>
using namespace std;
int main()
{
array <_int64, 100>x;
x[0] = x[1] = 1;
for (int i = 2; i < 100; i++)
{
x[i] = x[i - 1] + x[i - 2];
cout << i << "--->" << x[i] << "\n";
}

system("Pause");
return 0;
}

B10233095李元宏 提到...

#include
#include
using namespace std;
int main()
{
int a;
int b[45];
b[0] = 0;
b[1] = 1;

for (a = 2; a <= 45; a++)
{
b[a] = b[a - 1] + b[a - 2];
cout << b[a] << endl;
}
system("pause");

}

B10233185 提到...

#include
#include
using namespace std;
int main()
{
int a;
int b[45];
b[0] = 0;
b[1] = 1;

for (a = 2; a <= 45; a++)
{
b[a] = b[a - 1] + b[a - 2];
cout << b[a] << endl;
}
system("pause");

}

B10233082 唐偉強 提到...

#include
#include
#include
using namespace std;

int main()
{
arrayx;
x[0] = x[1] = 1;
for (int i = 2; i < 40; i++)
{
x[i] = x[i - 1] + x[i - 2];
cout << i << "---" << x[i]<<endl;
}
system("Pause");
return 0;
}

Related Posts Plugin for WordPress, Blogger...

熱門文章