2009-10-22 18:38:11來源不明
Order's computation process
有空再補上遞迴版
/***************************************************/
#include<stdlib.h>
#include<stdio.h>
main()
{
int a,b,n;
while(scanf("%d",&n)==1)
{
int temp=n;
if(n==0) {printf("0! = 1 = 1\n");continue;}
printf("%d! = %d",n,n);
for(a=n-1;a>=1;a--)
temp=temp*a,printf(" * %d",a);
printf(" = %d\n",temp);
}
return 0;
}