Advertisement
Kentoo

M#1

Dec 4th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include "windows.h"
  4.  
  5. using namespace std;
  6.  
  7. void main()
  8. {
  9.     SetConsoleCP(1251);
  10.     SetConsoleOutputCP(1251);
  11.     const int N = 18;
  12.     double a[N];
  13.     double b[N];
  14.     double min;
  15.     cout << "Введите элементы массива" << endl;
  16.     for (int i = 0; i < N; i++) {
  17.         cin >> a[i];
  18.         if (i == 0)
  19.             min = a[i];
  20.         else
  21.             if (a[i] < min)
  22.                 min = a[i];
  23.     }
  24.     if (min > 18.3)
  25.         for (int i = 0; i < N; i++)
  26.             b[i] = a[i] * 2;
  27.     else
  28.         for (int i = 0; i < N; i++)
  29.             b[i] = a[i] / 2;
  30.     for (int i = 0; i < N; i++) {
  31.         cout << b[i] << " ";
  32.     }
  33.     cout << endl;
  34.     system("pause");
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement