![]() |
#2
非死亡!2011-11-09 18:45
|
#include<iostream>
using namespace std;
void print(int w)
{ int i;
if( w ) //怎么理解
{ print( w-1 );
for( i=1; i<=w; i++ )
cout << w << " ";
cout << endl;
}
}
void main()
{ print( 5 );
}
现有一递归函数。想请教,通常if 是用于判断。if括号里,只有一个变量,是怎么理解