Advertisement
Guest User

Untitled

a guest
Dec 17th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include "iostream"
  3. #include "ctime"
  4. using namespace std;
  5.  
  6.  
  7. void main()
  8. {
  9. setlocale(LC_ALL, "rus");
  10. const int n = 10;
  11. srand(time(0));
  12. int i, a;
  13. double m[n], k =m[0];
  14. for (i = 0; i < n; i++)
  15. {
  16. m[i] = rand() % 30;
  17. cout << m[i]<<endl;
  18. }
  19. for (i = 0; i < n; i++)
  20. if (m[i] < k)
  21. k = m[i];
  22. a = k;
  23. cout << a << endl;
  24. if (a % 2 == 0)
  25. cout << "наименьшее из чисел четное\n";
  26. else
  27. cout << "наименьшее из чисел нечетное\n";
  28. system("pause");
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement