Exercise 1
A week is considered an extreme hot week if there are 4
days with temperature over than 35oC. Write a program to
input the temperature of 7 days, and print 1 if that week
is an extreme hot week, and print 0 otherwise.
Input
• A float array of 7 elements
Output
• A value of 0 or 1
Example
Input Output
30, 35.5, 37.6, 37, 36.5,
1
37.5, 36.5
30, 31.5, 30.6, 31, 33.5,
0
35.5, 36.5
Exercise 2
Write a program that allows entering an array of integers
(up to 10 elements), printing to the screen the largest
product of two consecutive elements. If the array has only
1 element return 0.
Input:
- Line 1 contains an integer n, the number of elements of
the array (2 <= n <=10)
- Line 2: contains a list of numbers separated by spaces
Output:
- The product of the largest 2 consecutive elements
Example
Input Output
4
27
19326
1
0
29