Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. `#include <stdio.h>
  2. int check(int a, int b[])
  3. {int c=0;
  4. for (int i=0; i<6; i++)
  5. if(b[i] == a)
  6. c++;
  7. return c;}
  8. int main ()
  9. {
  10. int a[6];
  11. int b[6];
  12. for (int i=0; i<6; i++)
  13. scanf("%d",& a[i]);
  14. for (int i=0; i<6; i++)
  15. scanf("%d",& b[i]);
  16. if (check(a[1],a)-1 == check(a[1],b))
  17. {printf("Not a premutation"); return 1;}
  18. for (int i=0; i<6; i++)
  19. if (check(a[1],a) == check(a[1],b))
  20. {printf("Not a premutation"); return 1;}
  21. printf("Permutation");
  22. return 0;
  23. }`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement