Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.school;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner in = new Scanner(System.in);
- int arr[] = new int[10];
- double average = 0;
- int mult = 1;
- for (int i = 0; i < 10; i++) arr[i] = in.nextInt();
- Расчет среднего значения
- for (int i = 0; i < 10; average += arr[i++]);
- average *= 0.1;
- // Расчет произведения элементов меньше среднего
- for (int i = 0; i < 10; i++)
- if (arr[i] < average)
- mult *= arr[i];
- System.out.println(mult);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement