Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- #include <ctime> //библиотека для time
- using namespace std;
- int main(){
- setlocale(LC_ALL,"RUSSIAN");
- int max = 0, min = 41;
- const int N = 10;
- int mass[N];
- srand(time(NULL));
- for (int i = 0; i<N; i++){
- mass[i] = 1+rand()%40;
- cout << mass[i] << " ";
- }
- for (int i = 0; i<N; i++) {
- if (mass[i]<min) {
- min = mass[i];
- }
- if (mass[i]>max) {
- max = mass[i];
- }
- }
- cout << "\n" << "Максимум: " << max << endl;
- cout << "Минимум " << min << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement