思路:
递推出来斯特林数 求个和
if(i==j)f[i][j]=1;
else f[i][j]=f[i-1][j-1]+f[i-1][j]*j;
//By SiriusRen
#include <cstdio>
using namespace std;
double f[108][108],ans[108];
int n;
int main(){
for(int i=1;i<=105;i++){
for(int j=1;j<=i;j++)
if(i==j)f[i][j]=1;
else f[i][j]=f[i-1][j-1]+f[i-1][j]*j;
for(int j=1;j<=i;j++)ans[i]+=f[i][j];
}
while(scanf("%d",&n)&&n)
printf("%d %.0lf
",n,ans[n]);
}