#include <iostream>
#include <time.h>
using namespace std;
int main(){
setlocale(LC_ALL, "Russian");
int a, b, arr[25], s=0, k=0;
srand(time(0));
for (int i=0; i<25; ++i) {
arr[i]=rand()%71-20;
cout<<arr[i]<<" ";
}
cout<<endl<<"Введите a и b: ";
cin>>a>>b;
for (int i=0; i<25; ++i) if (arr[i]>=a && arr[i]<=b) {++k; s+=arr[i];}
cout<<"Кол-во: "<<k<<endl<<"Сумма: "<<s;
return 0;
#include <iostream>
#include <time.h>
using namespace std;
int main(){
setlocale(LC_ALL, "Russian");
int a, b, arr[25], s=0, k=0;
srand(time(0));
for (int i=0; i<25; ++i) {
arr[i]=rand()%71-20;
cout<<arr[i]<<" ";
}
cout<<endl<<"Введите a и b: ";
cin>>a>>b;
for (int i=0; i<25; ++i) if (arr[i]>=a && arr[i]<=b) {++k; s+=arr[i];}
cout<<"Кол-во: "<<k<<endl<<"Сумма: "<<s;
return 0;
}