Увеличь. есть только такая . Надеюсь понравится .
#include <iostream>
#include <stdlib.h>
using namespace std;
int main() {
const int n = 10;
int a[n];
double s=0;
int k=0;
srand(time(0));
for (int i = 0; i < n; i++) {
a[i]=-20 + (101.0 / RAND_MAX) * rand();
cout << a[i] << " ";
}
cout <<"\n";
for (int i = 0; i <= n; i++){
s = s+a[i];
}
s = s/n;
cout << "Среднее = " << s <<"\n";
for (int i = 0; i <= n; i++){
if (a[i]>s) k++;
}
cout << "k = " << k <<"\n";
return 0;
}
Пример:
<span>-18 80 77 66 74 44 62 78 45 0
Среднее = 50.9
k = 6</span>
(A ∨ B) ∧ C ∨ ¬A
Или вот так можно записать:
(A ИЛИ B) И C ИЛИ НЕ A
===== PascalABC.NET =====
begin
var (a, b, R) := ReadReal3('Введите a, b, R:');
var (x0, h, xn) := ReadReal3('Введите x0, h, xn:');
var (x, k) := (x0, 0);
while x <= xn + h / 2 do
begin
if Sqr(x - a) + Sqr(Sin(x) + Cos(x) - b) <= R * R then
k += 1;
x += h
end;
Print('Количество значений равно', k)
end.