Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main ()
- {
- int n,A[1001],cnt=0;
- cin>>n;
- for(int i=1; i<=n;i++)
- cin>>A[i];
- //fac perechi
- int ok=1;//presupun ca !=
- for(int i=1; i<=n;i++)
- for(int j=i; j<=n; j++)
- if(i!=j && A[i]==A[j])
- ok=0;//2 == => nu!=
- if(ok)
- cout<<"DA";
- else
- cout << "NU";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement