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
- GCD CountingGC
- Nth Digit【難】Git
- Last digit of a huge numberASTGit
- ZOJ First Digit(瞎搞)Git
- 計數排序 - Counting Sort排序
- D - Digit vs Square RootGit
- Automatic Reference Counting-SwiftSwift
- LintCode-Digit CountsGit
- python ref counting based garbage collectionPython
- iOS中的Reference Counting詳解iOS
- 【LeetCode】Counting Bits(338)LeetCode
- LeetCode 338 Counting BitsLeetCode
- Codeforces 954H Path Counting
- Nth Digit 第N個數字Git
- LeetCode-Number of Digit OneLeetCodeGit
- 233. Number of Digit OneGit
- Leetcode 400.Nth DigitLeetCodeGit
- HDU 1060 Leftmost DigitGit
- projecteuler---->problem=19----Counting SundaysProject
- CF1919E Counting Prefixes
- leetcode [python] 【338】Counting BitsLeetCodePython
- LeetCode 第 338 題 (Counting Bits)LeetCode
- Python演算法:Counting 101Python演算法
- 338. Counting Bits--LeetCode RecordLeetCode
- HDU 1060 Leftmost Digit(數論,c++)GitC++
- [CERC2015] Digit Division 題解Git
- P9640 [SNCPC2019] Digit ModeGit
- [ARC158C] All Pair Digit Sums 題解AIGit
- 剖析網路測量:Counting and Measuring Network Traffic
- Codeforces 372B Counting Rectangles is Fun:dp套dp
- HDU 5439 Aggregated Counting(找規律+預處理)
- POJ3187Backward Digit Sums[楊輝三角]Git
- BZOJ4421 : [Cerc2015] Digit DivisionGit
- 信奧一本通1164:digit函式Git函式
- HDU 5862 Counting Intersections(樹狀陣列+掃描線+離散化)陣列
- C++搜尋與回溯演算法之Lake Counting(數湖)C++演算法
- 生成元(Digit Generator, AMC/ICPC Seoul 2005, UVa1583)Git