Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int v[100],n,m,ap[100],i;
- cout<<"n=";cin>>n;
- cout<<"m=";cin>>m;
- for (i=0;i<m;i++)
- ap[i]=i;
- for (i=0;i<n;i++)
- cin>>v[i];
- for (i=0;i<n;i++)
- ap[v[i]]++;
- for (i=0;i<m;i++)
- cout<<"Elementul "<<i<<" apare de "<<ap[i]<<" ori\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement