Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- char с;
- int b[9];
- for (int i =0;i<10;i++)
- b[i]=0;
- for (int i =0;i<n;i++)
- {
- cin >> с;
- if (с=='0')
- b[0]++;
- else if (с=='1')
- b[1]++;
- else if (с=='2')
- b[2]++;
- else if (с=='3')
- b[3]++;
- else if (с=='4')
- b[4]++;
- else if (с=='5')
- b[5]++;
- else if (с=='6')
- b[6]++;
- else if (с=='7')
- b[7]++;
- else if (с=='8')
- b[8]++;
- else if (с=='9')
- b[9]++;
- }
- for (int i =0;i<10;i++)
- cout << b[i] << " ";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement