1234567891011121314151617181920
#include <iostream> using namespace std; int main() { int n, i; for(i=10;i<=100;i++) { n=i%10; i=i/10; if(n>i) { i=i*10+n; cout<<i<<" "<<n; } } return 0; }
123
for( int first = 1 ; first < 10 ; ++first ) // first digit for( int second = first+1 ; second < 10 ; ++second ) // second digit (> first digit) std::cout << first << second << " (" << first*10 + second << ")\n" ;