Digit Counting uva1225
#include<stdio.h>
#include<string.h>
int main()
{
int i;
int a[10];
scanf("%d",&i);
for(int k=0;k<i;k++)
{
memset(a,0,sizeof(a));
int n;
scanf("%d",&n);
for(int j=1;j<=n;j++)
{
int k=j;
while(k!=0)
{
a[k%10]++;
k/=10;
}
}
for(int j=0;j<9;j++)
{
printf("%d ",a[j]);
}
printf("%d\n",a[9]);
}
return 0;
}
自己寫的程式,歡迎探討。
相關文章
- UVa 1225 - Digit CountingGit
- Nth Digit【難】Git
- Last digit of a huge numberASTGit
- ZOJ First Digit(瞎搞)Git
- 計數排序 - Counting Sort排序
- LintCode-Digit CountsGit
- Automatic Reference Counting-SwiftSwift
- Nth Digit 第N個數字Git
- LeetCode-Number of Digit OneLeetCodeGit
- 233. Number of Digit OneGit
- Leetcode 400.Nth DigitLeetCodeGit
- HDU 1060 Leftmost DigitGit
- python ref counting based garbage collectionPython
- iOS中的Reference Counting詳解iOS
- 【LeetCode】Counting Bits(338)LeetCode
- LeetCode 338 Counting BitsLeetCode
- Codeforces 954H Path Counting
- projecteuler---->problem=19----Counting SundaysProject
- leetcode [python] 【338】Counting BitsLeetCodePython
- LeetCode 第 338 題 (Counting Bits)LeetCode
- Python演算法:Counting 101Python演算法
- 338. Counting Bits--LeetCode RecordLeetCode
- HDU 1060 Leftmost Digit(數論,c++)GitC++
- POJ3187Backward Digit Sums[楊輝三角]Git
- BZOJ4421 : [Cerc2015] Digit DivisionGit
- 剖析網路測量:Counting and Measuring Network Traffic
- Codeforces 372B Counting Rectangles is Fun:dp套dp
- HDU 5439 Aggregated Counting(找規律+預處理)
- HDU 5862 Counting Intersections(樹狀陣列+掃描線+離散化)陣列
- C++搜尋與回溯演算法之Lake Counting(數湖)C++演算法
- 生成元(Digit Generator, AMC/ICPC Seoul 2005, UVa1583)Git
- HDU - 1061 Rightmost Digit(二分快速冪板題)Git
- 線性時間的排序 - Decision Tree Model & Counting Sort & Radix Sort & Bucket Sort排序
- PARI/GP網站上連線的一本書The SIAM 100-Digit Challenge網站Git
- oracle lz047中的REGEXP_LIKE(cust_first_name,'[[:digit:]]')) 轉OracleGit
- Automatic Reference Counting(ARC)特性學習(iOS5新特性學習之五)iOS
- Martyr2專案實現——Number部分的問題求解 (1) Find Pi to Nth DigitGit
- 洛谷題單指南-搜尋-P1596 [USACO10OCT] Lake Counting S