#include"iostream"
#include"stdio.h"
#include"stack"
#include"string"
using namespace std;
int main()
{
//freopen("a.txt","r",stdin);
int n;
cin>>n;
while(n--)
{
int fu[10]={0};
string a;
int i;
int nk;
cin>>nk;
for(i=1;i<=nk;i++)
{
stack<int>ak;
int t=i;
while(t)
{
int r=t%10;
ak.push(r);
t/=10;
}
while(!ak.empty())
{
int top=ak.top();
a.push_back (top+48);
ak.pop();
}
}
for(auto p=a.begin();p!=a.end();p++)
fu[*p-48]++;
int f=1;
for(i=0;i<10;i++)
{
if(f) f=0;
else cout<<" ";
cout<<fu[i];
}
cout<<endl;
}
return 0;
}
UVA1225
最新推荐文章于 2023-02-06 16:25:28 发布