查一下,以前的帖子.
#include <iostream.h>void print(int w){ if(w>1) print(w-1); for(int c=0;c<w;c++) cout<<w<<" "; cout<<endl; }void main(){print(5);}
运行显示:12 23 3 34 4 4 45 5 5 5 5