Advertisement
Guest User

Untitled

a guest
Jun 25th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void sk(int X[], int Y[], int &Mdydis)
  6. {
  7. int i, j, d = 0;
  8.  
  9. for (i=0; i<Mdydis; i++)
  10. {
  11. if (X[i] == Y[i])
  12. {
  13. cout << "+";
  14. }
  15. if (Y[i] != X[i])
  16. {
  17. for (j=0; j<Mdydis; j++)
  18. {
  19. if (Y[i] == X[j])
  20. {
  21. cout << "*";
  22. break;
  23. }
  24. if (Y[i] != X[j])
  25. {
  26. d += 1;
  27. }
  28. }
  29. if (d==Mdydis)
  30. {
  31. cout << "-";
  32. }
  33. }
  34. if (i < Mdydis-1)
  35. {
  36. cout << ",";
  37. }
  38. d = 0;
  39. }
  40. }
  41.  
  42. int main()
  43. {
  44. int x[6] = { 2, 6, 6, 3, 5, 3 };
  45. int y[6] = { 4, 5, 6, 1, 8, 9 };
  46. int xL = sizeof(x)/sizeof(x[0]);
  47. sk(x, y, xL);
  48. return 0;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement