484 - The Department of Redundancy Department
#include <iostream>
#include <map>
using namespace std;
map<int,int>mp;
int main()
{
int n, ary[1000000],i,c=0;
while(cin>>n)
{
if(mp[n]==0)
{
ary[c++]=n;
}
mp[n]=mp[n]+1;
}
for(i=0;i<c;i++)
{
cout<<ary[i]<<" "<<mp[ary[i]]<<endl;
}
return 0;
}
#include <iostream>
#include <map>
using namespace std;
map<int,int>mp;
int main()
{
int n, ary[1000000],i,c=0;
while(cin>>n)
{
if(mp[n]==0)
{
ary[c++]=n;
}
mp[n]=mp[n]+1;
}
for(i=0;i<c;i++)
{
cout<<ary[i]<<" "<<mp[ary[i]]<<endl;
}
return 0;
}
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন