#include #include #include
using namespace std;
int main(){setlocale(LC_ALL, "RUSSIAN");const int N = 10;int arr[N];int K, L, sum = 0, sumexcl = 0;srand(time(NULL));for (int i = 0; i < N; i++){ arr[i] = rand() % 10; sum += arr[i];}cout << "Введите K >> "; cin >> K;cout << "Введите L >> "; cin >> L;for (int i = 0; i < N; i++){ cout << arr[i] << " "; if((i>=K) && (i<=L)) sumexcl += arr[i];}sum -= sumexcl;cout << "Результат: " << sum << endl;system("pause");}