Sum of squares of even numbers
Rust
Easy
iterators
Task «Sum of squares of even numbers»
Write a Rust program that reads a sequence of integers separated by spaces and uses iterators to find the sum of squares of all even numbers. If there are no even numbers, output 0.
Input Format
One line containing integers separated by spaces.
Output Format
One integer — the sum of squares of even numbers.
Examples
Example 1
INPUT
1 2 3 4
OUTPUT
20
Example 2
INPUT
2 4 6
OUTPUT
56
main.rs