Problem2222--C Programming Sit: Array

2222: C Programming Sit: Array

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 569  Solved: 83
[Submit] [Status] [Web Board] [Creator:]

Description

Write a C program that reads 5 integers from the keyboard and saves them in an array, sorts and prints the integers in ascending order, and prints the sum of elements whose subscript is even (i.e., elements whose index is 0, 2, 4).

Input

5 integers

Output

5 integers sorted in ascending order, and the sum of elements at positions 0, 2, 4

Sample Input Copy

4 1 9 2 5

Sample Output Copy

1 2 4 5 9 14

Source/Category

264