#include<iostream>
using namespace std;
int main()
{
int t,b,n;
cin>>t;
while(t--)
{
cin>>b;
n=1;
while(b>n)//n代表第几个串
{
b-=n;
n++;
}
if(b%9==0)//b在一个串中的位置
cout<<9<<endl;
else
cout<<b%9<<endl;
}
return 0;
}
假设: S1 = 1 S2 = 12 S3 = 123 S4 = 1234 ......... S9 = 123456789 S10 = 1234567891 S11 = 123456
猜你喜欢
转载自blog.csdn.net/qq_40835329/article/details/81229384
今日推荐
周排行