习题2.29

来源:互联网 发布:电子烟发热丝数据 编辑:程序博客网 时间:2024/05/22 20:29
#include<iostream>  02.using namespace std;  03.int main()  04.{  05.    int *p=new int[20];  06.    *p=1;  07.    *(p+1)=1;  08.    cout<<*p<<"\t"<<*(p+1)<<"\t";  09.    p=p+2;  10.    for(;*p<=19;p++)  11.    {  12.        *p=*(p-1)+*(p-2);  13.        cout<<*p<<"\t";  14.        if(*p%3==0)  15.            cout<<endl;  16.    }  17.    return 0;  18.}  

0 0
原创粉丝点击