链接
http://acm.nyist.net/JudgeOnline/problem.php?pid=32
函数的双重调用
代码:
查看代码---运行号:723283----结果:Accepted
运行时间:
2014-02-17 14:19:39 | 运行人:
shengweisong
01.
#include<stdio.h>
02.
//#include<stdlib.h>
03.
#define MAXN 11
04.
int
a[MAXN];
05.
int
s, h;
06.
int
zhs(
int
n,
int
m )
//函数双重调用
07.
{
08.
int
i;
09.
if
( m == 0 )
10.
{
11.
for
( i = h; i > 0; i -- )
12.
printf
(
"%d"
, a[i] );
13.
printf
(
"\n"
);
14.
return
0;
15.
}
16.
for
( i = n; i >= m; i -- )
17.
{
18.
a[m] = i;
19.
zhs( i -1, m -1 );
20.
}
21.
}
22.
int
main()
23.
{
24.
scanf
(
"%d%d"
, &s, &h ) ;
25.
zhs( s, h );
26.
// system ( "pause" );
27.
}