UVA 1229

xiaoxiao2021-03-01  13

#include<iostream> using namespace std; int main() { int n; cin>>n; while(n--) { int goal; cin>>goal; int s[12]; for(int i=0; i<12; ++i) s[i]=0; for(int i=1;i<=goal;++i) { int t=i; while(t>0) { s[t]++; t/=10; } } for(int i=0; i<9; ++i) cout<<s[i]<<" "; cout<<s[9]; cout<<endl; } return 0; }

 

转载请注明原文地址: https://www.6miu.com/read-4050033.html

最新回复(0)