C++ 对数组的操作示例

#include <iostream>

using namespace std ;

int main ()
{
     int ( * fb) = new int [ 20 ];
    ( * fb) = 0 ;
    fb ++ ;
    ( * fb) = 1 ;
     int i;
     int last1 = 1 , last2 = 0 ;
     for (i = 2 ; i < 19 ; i ++ )
    {
        ( * fb) = last1 + last2;
        last2 = last1;
        last1 = * fb;
        cout << ( * fb) << endl;
        fb ++ ;
    }
     delete [] fb;
     return 0 ;
}


猜你喜欢

转载自blog.csdn.net/nightchenright/article/details/80867108