Language: C++

//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <queue>
#include <iterator>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int gcd(int a, int b){
   int tmp;
   while(a%b==0){
      tmp=a%b;
      a=b;
      b=tmp;
   }
}

int lcm(int a,int b){
   return a*b/gcd(a,b);
}

bool prime_number(int n){
   vector<bool> i;
   if(n < 2){
      return false;
   }
   else if(n == 2){
      return true;
   }
   if(n % 2 == 0){
      return false;
   }
   for(int i=3;i<=n/i;i+=2){
      if(n % i == 0) return false;
      return true;
   }
}

int main(){
   int n, s,ans=0;
   while(1){
      cin >> n >> s;
      ans=0;
      if(n+s==0) break;
      if(n==1) cout << 1 << endl;
      if(n==2) cout << n/2+n%2 << endl;
      if(n==3){
         FOR(i,0,101-n)FOR(j,i+1,102-n)FOR(k,j+1,103-n)if(i+j+k==s){
            ans++; break;
         }
      }
      if(n==4){
         FOR(i,0,101-n)FOR(j,i+1,102-n)FOR(k,j+1,103-n)
         FOR(l,k+1,104-n)if(i+j+k+l==s){
            ans++; break;
         }
      }
      if(n==5){
         FOR(i,0,101-n)FOR(j,i+1,102-n)FOR(k,j+1,103-n)
         FOR(l,k+1,104-n)FOR(m,l+1,105-n)if(i+j+k+l+m==s){
            ans++; break;
         }
      }
      if(n==6){
         FOR(i,0,101-n)FOR(j,i+1,102-n)FOR(k,j+1,103-n)
         FOR(l,k+1,104-n)FOR(m,l+1,105-n)FOR(o,m+1,106-n)
         if(i+j+k+l+m+o==s){
            ans++; break;
         }
      }
      if(n==7){
         FOR(i,0,101-n)FOR(j,i+1,102-n)FOR(k,j+1,103-n)
         FOR(l,k+1,104-n)FOR(m,l+1,105-n)FOR(o,m+1,106-n)
         FOR(p,o+1,107-n)if(i+j+k+l+m+o+p==s){
            ans++; break;
         }
      }
      if(n==8){
         FOR(i,0,101-n)FOR(j,i+1,102-n)FOR(k,j+1,103-n)
         FOR(l,k+1,104-n)FOR(m,l+1,105-n)FOR(o,m+1,106-n)
         FOR(p,o+1,107-n)FOR(q,p+1,108-n)
         if(i+j+k+l+m+o+p+q==s){
            ans++; break;
         }
      }
      if(n==9){
         FOR(i,0,101-n)FOR(j,i+1,102-n)FOR(k,j+1,103-n)
         FOR(l,k+1,104-n)FOR(m,l+1,105-n)FOR(o,m+1,106-n)
         FOR(p,o+1,107-n)FOR(q,p+1,108-n)FOR(r,q+1,109-n)
         if(i+j+k+l+m+o+p+q+r==s){
            ans++; break;
         }
         if(i>s) break;
      }
      
      cout << ans << endl;
   }
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:81:1: warning: no return statement in function returning non-void [-Wreturn-type]
   81 | }
      | ^
a.cc: In function 'int main()':
a.cc:158:13: error: 'i' was not declared in this scope
  158 |          if(i>s) break;
      |             ^
a.cc: In function 'bool prime_number(int)':
a.cc:102:1: warning: control reaches end of non-void function [-Wreturn-type]
  102 | }
      | ^