Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- // 12134
- // 12134 % 10 = 4
- // 12134/10 = 1213
- int cont[10]; // Tudo zeros
- int main() {
- int n;
- cin >> n;
- int x, temp1;
- for(int i=0;i<n;i++){
- cin >> x;
- if (x > 0) {
- while(x >= 1){
- temp1 = x % 10;
- x = x / 10;
- cont[temp1]++;
- }
- } else {
- cont[0]++;
- }
- }
- for(int c=0;c<10;c++){
- cout<<c<<" - "<<cont[c]<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement