|
|
DataMuseum.dkPresents historical artifacts from the history of: Bogika Butler |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Bogika Butler Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 896 (0x380)
Types: TextFile
Names: »SAMP4.C«
└─⟦d3d1d07f5⟧ Bits:30009789/_.ft.Ibm2.50006621.imd Mogens Pelles Zilog 80,000 / EOS projekt
└─⟦this⟧ »SAMP4.C«
#include "auxfn.h"
#define COL 6
main()
æ
int n,i,j,space;
int aaÆ30Å,bbÆ30Å;
char instrÆ80Å;
puts("ØnØnSample program #4 : Constructs Pascal's triangleØn");
do æ
puts("Enter a number < 15 : ");
gets(instr);
n=atoi(instr);
å while (n<0 øø n>15);
puts("Øn");
space = n*COL/2;
aaÆ0Å=0; aaÆ1Å=1;
for(j=1;j<=n;++j) æ
space=space-COL/2;
for(i=0;i<=space;++i) putchar(' ');
for(i=1;i<=j;++i) æ
bbÆiÅ=aaÆi-1Å+aaÆiÅ;
å
aaÆj+1Å=0;
for(i=1;i<=j;++i) æ
print(bbÆiÅ,COL);
aaÆiÅ=bbÆiÅ;
å
puts("Øn");
å
å
print(num,ic)
int num,ic;
æ
int i,j;
j=num;
i=0;
do æ
i=i+1;
j=j/10;
å while(j!=0);
if(i>ic) for(i=1;i<=ic;++i) putchar('*');
else
for(j=1;j<=ic-i;++j) putchar(' ');
putnum(num);
å
«eof»