#include<stdio.h>
#include<string.h>
#include<math.h>
#include<iostream>
#include<limits.h>
#include<algorithm>
#include<queue>
#include<vector>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<map>
#include<cctype>
using namespace std;
int main()
{
int sum,q,j,m,result,flag;
for(int n=1;n<=2;n++)
{ result=0;
for(int i=1;i<=1000000000;i++)
{
j=i;
flag=sum=0;
while(j>0)
{
sum+=j%10;
j=j/10;
if(sum>n)
break;
}
if(sum==n)
result++;
}
printf("%d\n",result);
}
}
1 #include<stdio.h>
2 #include<string.h>
3 #include<math.h>
4 #include<iostream>
5 #include<limits.h>
6 #include<algorithm>
7 #include<queue>
8 #include<vector>
9 #include<set>
10 #include<stack>
11 #include<string>
12 #include<sstream>
13 #include<map>
14 #include<cctype>
15 using namespace std;
16 int main()
17 {
18 int a[]={0,10,45,165,495,1287,3003,6435,12870,24310,43749,75501,125565,202005,315315,478731,708444,1023660,1446445,2001285,2714319,3612231,4720815,6063255,7658190,9517662,11645073,14033305,16663185,19502505,22505751,25614639,28759500,31861500,34835625,37594305,40051495,42126975,43750575,44865975,45433800,45433800,44865975,43750575,42126975,40051495,37594305,34835625,31861500,28759500,25614639,22505751,19502505,16663185,14033305,11645073,9517662,7658190,6063255,4720815,3612231,2714319,2001285,1446445,1023660,708444,478731,315315,202005,125565,75501,43749,24310,12870,6435,3003,1287,495,165,45,9,1};
19 int n;
20 while(scanf("%d",&n)!=EOF)
21 {
22 printf("%d\n",a[n]);
23 }
24 return 0;
25 }