原创  TJU1008 收藏

#include "stdio.h"
int main()
{
 int a,b;
 void tran(int a);
 b=0;
 while(scanf("%d",&a)!=EOF)
 {
   b++;
   if (b>1) printf("\n");
   printf("Case %d:\n",b);
   tran(a-1);
 }
 return 0;
}

void tran(int P)
{
  int a[P],r,c;
  for(r=0;r<=P;r++)
 {
 a[r]=1;
 for(c=r-1;c>=1;a[c--]+=a[c-1]);
 printf("%*d",1,a[0]);
 for(c=1;c<=r;printf(" %d",a[c++]));
 printf("\n");
 }
}

发表于 @ 2005年08月28日 11:48:00 | 评论( loading... ) | 编辑| 举报| 收藏

旧一篇:第一次做,AC的TJU1001,留念~ | 新一篇:tju1012 aced

  • 发表评论
  • 评论内容:
  •  
Copyright © DooDu
Powered by CSDN Blog