标签:style blog http color os strong io for
#include<iostream>
#include<cstdio>
#include<queue>
#include<algorithm>
using namespace std;
queue<int> Q;
int temp;
void tringle(const int n)
{
Q.push(1);
for(int i=2;i<=n;i++)
{
Q.push(1);
for(int j=1;j<=i-2;j++)
{
temp=Q.front();
Q.pop();
printf(" %d",temp);
temp=temp+Q.front();
Q.push(temp);
}
int x=Q.front();
Q.pop();
printf(" %d\n",x);
Q.push(1);
}
while(!Q.empty())
{
temp=Q.front();
Q.pop();
printf(" %d",temp);
}
}
int main()
{
tringle(6);
return 0;
}
标签:style blog http color os strong io for
原文地址:http://www.cnblogs.com/jianfengyun/p/3885122.html