online_judge_1073
来源:互联网 发布:淘宝上冷门的好东西 编辑:程序博客网 时间:2024/05/23 00:11
#include <stdio.h>#include <stdlib.h>int main(){ int *a,*b; int i,j,n,m; while(~scanf("%d",&n)) { a=(int *)malloc((n+1)*sizeof(int)); b=(int *)malloc((n+1)*sizeof(int)); a[0]=a[1]=1; b[0]=1; m=2; for(i=1;i<n;i++) { if(m%2==0) { for(j=0;j<m-1;j++) { printf("%d ",a[j]); b[j+1]=a[j]+a[j+1]; } printf("%d\n",a[j]); b[m]=1; } else { for(j=0;j<m-1;j++) { printf("%d ",b[j]); a[j+1]=b[j]+b[j+1]; } printf("%d\n",b[j]); a[m]=1; } m++; } free(a); free(b); } return 0;}
0 0
- online_judge_1073
- 简单编程 (二十六)窗体的创建
- JavaScript MVC 框架开源软件
- 一来就给LeetCode跪了
- 老版本的JDK下载地址
- 打算=
- online_judge_1073
- 蓝桥杯 人员排日程 伪DFS
- 回文数
- POJ3358 Period of an Infinite Binary Expansion【欧拉函数】
- Hadoop2.6.0安装过程中出现的问题(一)
- ESXI5.5 添加本地磁盘出错
- BZOJ 1107 POI2007 驾驶考试egz LIS
- gcc下__attribute__ ((constructor))和__attribute__ ((destructor))的使用
- 量子力学第三弹——力学量