1 2 3 4 5 6 7 8 9 10 11 12 13
|
#include <iostream>
void out( int i, int j, int N )
{
if ( i >= N ) return;
std::cout << i << ", " << j << '\n';
j == N ? out( i + 1, i + 2, N ) : out( i, j + 1, N );
}
int main()
{
out( 1, 2, 5 );
}
|
1, 2
1, 3
1, 4
1, 5
2, 3
2, 4
2, 5
3, 4
3, 5
4, 5 | |