Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int A[10] = {1, 3, 2, 4, 8, 11, 52, 3, 8, 7};
  6. int B[10] = {5, 4, 7, 8, 0, 24, 1, 12, 3, 6};
  7. int C[10];
  8.  
  9. int count = 0;
  10.  
  11. int max;
  12. int pos = 0;
  13.  
  14. int key = 1;
  15.  
  16. for (int i = 0; i < 10; i++)
  17. {
  18. key = 1;
  19. for (int j = 0; j < 10; j++)
  20. {
  21. if (A[i] == B[j]) key = 0;
  22. }
  23. if (key)
  24. {
  25. C[count] = A[i];
  26. count++;
  27. }
  28. }
  29.  
  30. max = C[0];
  31.  
  32. for (int i = 0; i < count; i++)
  33. {
  34. if (C[i] > max)
  35. {
  36. max = C[i];
  37. pos = i;
  38. }
  39. }
  40.  
  41. printf("Maksumalne znachena: %d\n", max);
  42. printf("Poryadkoviy nomer: %d\n", pos);
  43. system("pause");
  44. return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement