zort56

3 the same

Feb 1st, 2017
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8. int n, m=0;
  9. cin>>n;
  10. int a[n];
  11. for(int i=0 ; i<n ; i++)
  12. {
  13. cin>>a[i];
  14. }
  15. for(int i=0 ; i<n ; i++)
  16. {
  17. for(int j=0 ; j<i ; j++)
  18. {
  19. if(a[i]==a[j])
  20. {
  21. for(int k=j+1 ; k<i ; k++)
  22. {
  23. if(a[j]==a[k])m++;
  24. }
  25. }
  26. }
  27. }
  28. if(m)cout<<"TAK"<<endl;
  29. else cout<<"NIE"<<endl;
  30. //system("PAUSE");
  31. return EXIT_SUCCESS;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment