#include <iostream>
using namespace std;
const int N = 10;
int main()
{
int n , top ;
int i , j , k;
int temp ;
int stack[N] ;
while(cin >> n)
{
top = 0;
stack[0] = n;
char x;
while ( stack[0] != 1)
{
for( j = 0; j <= top ; j++)
cout << stack[j] << " ";
cout << endl;
j = top;
while (stack[j] == 1)
{
j -- ;
}
if (j == 0)
{
stack[j] = stack[j] - 1;
top = 0;
temp = n - stack[j];
while ( temp > stack[top])
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载