Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- int main()
- {
- const int boatCount = 35;
- double arr[boatCount], sum = 0, smallest = DBL_MAX;
- int count = 0;
- for (int i = 0; i < boatCount; i++)
- {
- std::cin >> arr[i];
- sum += arr[i];
- count += arr[i] >= 450 && arr[i] <= 1250;
- if (smallest > arr[i])
- {
- smallest = arr[i];
- }
- }
- std::cout << count << std::endl;
- for (int i = 0; i < boatCount; i++)
- {
- if (arr[i] == smallest)
- {
- std::cout << i << ' ';
- }
- }
- double avg = sum / boatCount;
- std::cout << std::endl << avg << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment