Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include "iostream"
- #include "ctime"
- using namespace std;
- void main()
- {
- setlocale(LC_ALL, "rus");
- const int n = 10;
- srand(time(0));
- int i, a;
- double m[n], k =m[0];
- for (i = 0; i < n; i++)
- {
- m[i] = rand() % 30;
- cout << m[i]<<endl;
- }
- for (i = 0; i < n; i++)
- if (m[i] < k)
- k = m[i];
- a = k;
- cout << a << endl;
- if (a % 2 == 0)
- cout << "наименьшее из чисел четное\n";
- else
- cout << "наименьшее из чисел нечетное\n";
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement