#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int a[10];
int b[10];
int la;
int lb = 0;
cin>>la;
for(int i = 0;i<la;i++)
{
cin>>a[i];
}
for(int i = 0;i<la;i++)
{
bool f = false;
for(int j = 0;j<lb;j++)
{
if(a[i] ==b[j])
{
f = true;
break;
}
}
if(f == false)
{
b[lb] = a[i];
lb++;
}
}
for(int i = 0;i<lb;i++)
{
cout<<b[i]<<" ";
}
return 0;
}
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int a[10];
int b[10];
int c[10];
int la;
int lbc = 0;
cin>>la;
for(int i = 0;i<la;i++)
{
cin>>a[i];
}
for(int i = 0;i<la;i++)
{
bool f = false;
for(int j = 0;j<lbc;j++)
{
if(a[i] ==b[j])
{
f = true;
c[j]++;
break;
}
}
if(f == false)
{
b[lbc] = a[i];
c[lbc] = 1;
lbc++;
}
}
for(int i = 0;i<lbc-1;i++)
{
for(int j = 0;j<lbc-1;j++)
{
if(c[i] < c[j+1])
{
int tmp=c[j];
c[j]=c[j+1];
c[j+1]=tmp;
tmp=b[j];
b[j]=b[j+1];
b[j+1]=tmp;
}
}
}
for(int i = 0;i<lbc;i++)
{
cout<<b[i]<<" "<<c[i]<<endl;
}
return 0;
}
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int a[10];
int b[10];
int n;
cin>>n;
int lb = 0;
for(int i = 0;i<n;i++)
{
cin>>a[i];
}
for(int i = 0;i<n;i++)
{
for(int j = i+1;j<n;j++)
{
int h = a[i]+b[j];
bool f = true;
for(int k = 0;i<lb;k++)
{
if(b[k] == h)
{
f = false;
break;
}
if(f ==true)
{
b[lb] = h;
lb++;
}
}
}
}
for(int i = 0;i<lb-1;i++)
{
for(int j = 0;j<lb-1-i;j++)
{
if(b[j]>b[j+1])
{
int tmp = b[j];
b[j] = b[j+1];
b[j+1] = tmp;
}
}
}
for(int i = 0;i<lb;i++)
{
cout<<b[i]<<" ";
}
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int a[10];
int b[10];
int c[0];
int n;
int lb = 0;
cin>>n;
int max = 0;
int maxi = 0;
for(int i = 0;i<n;i++)
{
cin>>a[i];
}
for(int i = 0;i<n;i++)
{
bool f = true;
for(int j = 0;j<lb;j++)
{
if(a[i]==b[j])
{
c[j]++;
f = false;
break;
}
}
if(f==true)
{
c[lb] = 1;
b[lb] = a[i];
lb++;
}
}
for(int i = 0;i<lb;i++)
{
if(c[i]>maxi)
{
maxi = c[i];
max = b[i];
}
}
cout<<max<<" "<<maxi;
return 0;
}
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int a[10];
int b[10];
int n,m;
cin>>n>>m;
int lb = 0;
for(int i = 0;i<=n;i++)
{
for(int j = 0;j<=m;j++)
{
int v = i*3 + j*5;
bool f = false;
for(int x = 0;x<lb;x++)
{
if(b[x] == v)
{
f = false;
break;
}
}
if(f == false)
{
b[lb] = v;
lb++;
}
}
}
for(int i = 0;i<n;i++)
{
for(int j = i+1;j<n;j++)
{
int h = a[i]+b[j];
bool f = true;
for(int k = 0;i<lb;k++)
{
if(f ==true)
{
b[lb] = h;
lb++;
}
}
}
}
for(int i = 0;i<lb-1;i++)
{
for(int j = 0;j<lb-1-i;j++)
{
if(b[j]>b[j+1])
{
int tmp = b[j];
b[j] = b[j+1];
b[j+1] = tmp;
}
}
}
for(int i = 0;i<lb;i++)
{
if(b[i]>0)cout<<b[i]<<" ";
}
return 0;
}
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int a[100];
int b[100];
int c[100];
int n;
cin>>n;
int lb = 0;
for(int i = 0;i<=n;i++)
{
cin>>a[i];
}
for(int i = 0;i<n;i++)
{
bool f = true;
for(int j = 0;j<lb;j++)
{
if(a[i] == b[j])
{
f = false;
c[j]++;
break;
}
if(f == true)
{
b[lb] = a[i];
c[lb] = 1;
lb++;
}
}
}
for(int i = 0;i<lb;i++)
{
cout<<b[i]<<":"<<c[i]<<endl;
}
return 0;
}