Go: package main

import (
	"bufio"
	"os"
	"strconv"
	"fmt"
)

func solve(a, b, c int) int {
	if a == 1 && b >= c && b < 10 {
		return 1
	}
	if a == 1 {
		return 0
	}
	ret := 0
	for i := c; i < 10 && i < b; i++ {
		ret += solve(a-1, b-i, i+1)
	}
	return ret
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	for {
		scanner.Scan()
		a, _ := strconv.Atoi(scanner.Text())
		if a == 0 {
			break
		}
		scanner.Scan()
		b, _ := strconv.Atoi(scanner.Text())
		fmt.Println(solve(a, b, 0))
	}
}

C++: #include<bits/stdc++.h>
using namespace std;

#define int long long
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

signed main(){
    int n,s;
    while(cin>>n>>s,n||s){
        int ans=0;
        rep(i,1<<10){
            int cnt=0,sum=0;
            rep(j,10){
                if(i>>j&1){
                    cnt++;
                    sum+=j;
                }
            }
            if(cnt==n&&sum==s)ans++;
        }
        cout<<ans<<endl;
    }
    return 0;
}

C++: #include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>

#define MP make_pair
#define PB push_back
#define ALL(x) (x).begin(),(x).end()
#define REP(i,n) for(int i=0;i<(n);i++)
#define REP1(i,n) for(int i=1;i<(n);i++)
#define REP2(i,d,n) for(int i=(d);i<(n);i++)
#define RREP(i,n) for(int i=(n);i>=0;i--)
#define CLR(a)      memset((a),0,sizeof(a))
#define MCLR(a)     memset((a),-1,sizeof(a))
#define RANGE(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<string> VS;
typedef vector<LL> VLL;
typedef pair<int, int> PII;

const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;

const int DX[] = { 1, 0, -1, 0 }, DY[] = { 0, -1, 0, 1 };

int combination(int a, int n,int s){
	if (a == 10){
		return s == 0 && n == 0;
	}
	else
		return combination(a + 1, n - 1, s - a) + combination(a + 1, n, s);
}

int main(){
	int n, s;

	do{
		cin >> n >> s;
		if (n == 0 || s == 0)
			break;

		cout << combination(0, n, s) << endl;
	} while (1);

	return 0;
}

C++: //#define _GRIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;

// ?????¬???????????¬??????
#pragma region MACRO
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define PED cout << "\n"
#define rep(i,n) for(int i=0; i<(int)n; ++i)
#define REP(i,x,n) for(int i=x; i<(int)n; ++i)
#define repi(i,n) for(int i=0; i<=(int)n; ++i)
#define REPI(i,x,n) for(int i=x; i<=(int)n; ++i)
#define ILP while(true)
#define FOR(i,c) for(__typeof((c).begin())!=(c).begin(); i!=(c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#pragma endregion

// ???
#pragma region TYPE_DEF
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<string, string> pss;
typedef pair<string, int> psi;
typedef pair<int, string> pis;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long double> vld;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<string> vs;
#pragma endregion

// Effective std
#pragma region ESTD
template<typename C, typename T> int count(C& c, T t) { return count(ALL(c), t); }
template<typename C, typename F> int count_if(C& c, F f) { return count_if(ALL(c), f); }
template<typename C, typename T> void erase(C& c, T t) { remove(ALL(c), t), c.end(); }
template<typename C> void remove(vector<C>& c, unsigned int index) { c.erase(c.begin()+index); }
template<typename C, typename T, typename U> void replace(C& c, T t, U u) { replace(ALL(c), t, u); }
template<typename C, typename F, typename U> void replace_if(C& c, F f, U u) { (ALL(c), f, u); }
template<typename C> void reverse(C& c) { reverse(ALL(c)); }
template<typename C> void sort(C& c) { sort(ALL(c)); }
template<typename C, typename Pred> void sort(C& c, Pred p) { sort(ALL(c), p); }
#pragma endregion

// ?????°
#pragma region CONST_VAL
constexpr int PI = (2*acos(0.0));
constexpr int EPS = (1e-9);
constexpr int MOD = (int)(1e9+7);
constexpr int INF = 100000000;
#pragma endregion

int dfs(int num, int rest, int before) {
    // return?????¶
    if(num==0) {
        if (rest==0) return 1;
        return 0;
    }
    int res = 0;
    for(int i=0; i<=rest && i <= before; ++i)
        res += dfs(num-1, rest-i, i-1);

    return res;
}

int main()
{
    int n, s;
    while(cin>>n>>s && (n!=0 || s!=0))
        P(dfs(n, s, 9));
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

int main(){
int a[15][200]{};
a[0][0]=1;
for(int b=0;b<=9;b++){
	for(int c=100;c>=b;c--){
		for(int d=10;d!=0;d--){
			a[d][c]+=a[d-1][c-b];
		}
	}
}
int x,y;
while(cin>>x>>y,x|y){
	printf("%d\n",a[x][y]);
}
}

C++:  
 #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 #include<queue>
 
 using namespace std;
 
 int a[10]={0,1,2,3,4,5,6,7,8,9};
 int n,s;
 int count_2;
 
 void dfs(int step,int i,int sum)
 {
   if(sum>s||step>n) return;
   if(i==10)
   {
     if(step==n&&i==10&&sum==s)
     {
       count_2++;
       return;                          
     }
     else return; 
   }    
   dfs(step,i+1,sum); 
   dfs(step+1,i+1,sum+a[i]);
   return;
 }
  
 int main()
 {
   while(cin>>n>>s)
   {
     if(n==0&&s==0) break;
     else
     {
       count_2=0;
       dfs(0,0,0);    
     } 
     cout<<count_2<<endl;               
   }
   //while(1);     
   return 0;  
 }

C++: #include <iostream>

using namespace std;


int n,s;

int count;

void dfs(int i,int j,int sum) {

  //cout << i << " " << j << " " << sum << endl;

  if(j==0 && sum==0) {

    count++;

    return;

  }

  if(i==10 || sum<=0) return;

  dfs(i+1,j-1,sum-i);

  dfs(i+1,j,sum);

  return;

}
  

int main() {

  while(cin >> n >> s,n!=0 && s!=0) {

    count=0;

    dfs(0,n,s);

    cout << count << endl;

  }

  return 0;

}

C++: #include <fstream>
#include <iostream>
#include <cmath>
#include <vector>
#include <queue>
#include <utility>
#include <algorithm>
using namespace std;

int cnt_sum_s(int n, int k, int s, int tmp_sum) {
  if (n == 0) {
    return (tmp_sum == s) ? 1 : 0;
  }

  int res = 0;
  for (int i = k+1; i < 10; i++) {
    res += cnt_sum_s(n-1, i , s, tmp_sum + i);
  }

  return res;
}

int main() {
  // ifstream cin("../test.txt");
  while (true) {
    int n,s;
    cin >> n >> s;
    if (!(n|s)) break;

    int res = cnt_sum_s(n, -1, s, 0);

    cout << res << endl;
  }
}

C++: #include <iostream>

using namespace std;

int rec(int n, int s, int over){
    if (s < 0 || n < 0)
        return 0;
    if (!n && !s)
        return 1;

    int count = 0;
    for (int i = over + 1; i < 10; i++)
        count += rec(n-1, s - i, i);

    return count;
}