Leon3226

Untitled

Oct 23rd, 2014
158
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>;
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int fmas[100], smas[100], min, i, fmn, smn, k;
  7. cout << "Enter number of numbers of first massive" << endl;
  8. cin >> fmn;
  9. cout << endl << "Enter number of numbers of second massive" << endl;
  10. cin >> smn;
  11. cout << "Enter each number of first massive" << endl;
  12. for (i = 0; i < fmn; i++)
  13. cin >> fmas[i];
  14. cout << "Enter each number of second massive" << endl;
  15. for (i = 0; i < smn; i++)
  16. cin >> smas[i];
  17. min = fmas[0];
  18. for (i = 0; i < fmn; i++)
  19. for (k = 0; k < smn; k++)
  20. if (fmas[i] == smas[k])
  21. break;
  22. else if (min > fmas[i])
  23. {
  24. min = fmas[i];
  25. break;
  26. }
  27. cout << min;
  28.  
  29. }
RAW Paste Data