📄 ch05.08.c
字号:
// #include <iostream>
#include <iostream.h>
/**
** The sum of the first eight elements of the Fibonacci series is 33
**/
int sumit( int *parray_begin, int *parray_end )
{
int sum = 0;
if ( ! parray_begin || ! parray_end )
return sum;
while ( parray_begin != parray_end )
sum += *parray_begin++;
return sum;
}
int ia[8] = { 0, 1, 1, 2, 3, 5, 8, 13 };
int main()
{
cout << "The sum of the first eight elements of "
<< "the Fibonacci series is "
<< sumit( ia, ia+8 )
<< endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -