Advertisement
Guest User

Untitled

a guest
Sep 29th, 2014
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <iostream>
  2. #include<fstream>
  3. using namespace std;
  4.  
  5. long a[51];
  6. int n,m,k=1;
  7.  
  8. void citire()
  9. {
  10.     ifstream fin("mult.in");
  11.     fin>>n;
  12.  
  13.     for (int i=1; i<=n; i++)
  14.         fin>>a[i];
  15.  
  16. }
  17.  
  18. int prelucrare()
  19. {
  20.     for(int i=1; i<=n; i++)
  21.         for(int j=i+1; j<=n; j++)
  22.             if(a[i]==a[j]) return 0;
  23.  
  24.  
  25.     return 1;
  26.  
  27. }
  28.  
  29.  
  30.  
  31.  
  32. int main()
  33. {
  34.     citire();
  35.  
  36.  
  37.     if(prelucrare()) cout<<"da";
  38.         else cout<<"nu";
  39.  
  40.     return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement