Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- `#include <stdio.h>
- int check(int a, int b[])
- {int c=0;
- for (int i=0; i<6; i++)
- if(b[i] == a)
- c++;
- return c;}
- int main ()
- {
- int a[6];
- int b[6];
- for (int i=0; i<6; i++)
- scanf("%d",& a[i]);
- for (int i=0; i<6; i++)
- scanf("%d",& b[i]);
- if (check(a[1],a)-1 == check(a[1],b))
- {printf("Not a premutation"); return 1;}
- for (int i=0; i<6; i++)
- if (check(a[1],a) == check(a[1],b))
- {printf("Not a premutation"); return 1;}
- printf("Permutation");
- return 0;
- }`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement