Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int v[1000],m[1000],n,i,j,ok,k;
- cout<<"n=";cin>>n;
- for (i=0;i<n;i++) {
- cout<<"v["<<i<<"]=";
- cin>>v[i];
- }
- k=0;
- for (i=0;i<n;i++)
- {
- ok=1;
- for (j=0;j<n;j++)
- if (v[i]==v[j]&&j!=i)
- ok=0;
- if (ok)
- {
- m[k]=v[i];
- k++;
- }
- }
- for (i=0;i<k;i++)
- cout<<"m["<<i<<"]="<<m[i]<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement