Advertisement
GerexD

ut, vonal, seta

Oct 18th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. int seta(int a[][30],int n,int x[],int h)
  2. {
  3. for(int i=1;i<h;i++)
  4. if(a[x[i]][x[i+1]==0) return 0;
  5. return 1;
  6. }
  7. int vonal(int a[][30],int n,int x[],int h)
  8. {
  9. if(!seta(a,n,x,h)) return 0;
  10. else{
  11. for(int i=1;i<h-1;i++)
  12. for(int j=i+1;j<h;j++)
  13. if((x[i]==x[j]) && x[i+1]==x[j+1])
  14.  
  15. if(x[i]==x[j+1] && x[i+1]==x[j])
  16. return 0;
  17. return 1;
  18.  
  19.  
  20. }
  21. }
  22. }
  23. int ut(int a[][30],int n,int x[],int h)
  24. {
  25. if(!seta(a,n,x,h)) return 0;
  26. else{for(int i=1;i<h-1;i++)
  27. for(int j=i+1;j<h;j++)
  28. if(x[i]==x[j]) return 0;
  29. return 1;
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement