'commit'
This commit is contained in:
20
TangDou/LuoGuBook/P1980_Study.cpp
Normal file
20
TangDou/LuoGuBook/P1980_Study.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
int x;
|
||||
const int N = 10;
|
||||
int b[N];
|
||||
// int -> INT_MAX-> 2^31-1
|
||||
// 2147483647
|
||||
// 1124324234 不溢出
|
||||
// 0232300000
|
||||
int main() {
|
||||
cin >> x;
|
||||
while (x) {
|
||||
int a = x % 10;
|
||||
b[a]++;
|
||||
x /= 10;
|
||||
}
|
||||
for (int i = 0; i <= 9; i++) cout << b[i] << " ";
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user