Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- int numbers[25];
- int negatives = 0;
- int positives = 0;
- int zeros = 0;
- int sum = 0;
- cout << "Введите 25 чисел" << endl;
- for (int i = 0; i < 25; i++) {
- cout << i << ": Введите число" << endl;
- int numb;
- cin >> numb;
- numbers[i] = numb;
- if (numb < 0) negatives++;
- else if (numb > 0) positives++;
- else zeros++;
- sum += abs(numb);
- }
- count << "Позитивных: " << positives << ". Негативных: " << negatives << " . Нулей: " << zeros << endl;
- count << "Среднее арифметическое: " << sum / (positives + negatives);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement