Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int A[10] = {1, 3, 2, 4, 8, 11, 52, 3, 8, 7};
- int B[10] = {5, 4, 7, 8, 0, 24, 1, 12, 3, 6};
- int C[10];
- int count = 0;
- int max;
- int pos = 0;
- int key = 1;
- for (int i = 0; i < 10; i++)
- {
- key = 1;
- for (int j = 0; j < 10; j++)
- {
- if (A[i] == B[j]) key = 0;
- }
- if (key)
- {
- C[count] = A[i];
- count++;
- }
- }
- max = C[0];
- for (int i = 0; i < count; i++)
- {
- if (C[i] > max)
- {
- max = C[i];
- pos = i;
- }
- }
- printf("Maksumalne znachena: %d\n", max);
- printf("Poryadkoviy nomer: %d\n", pos);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement