Submit | All submissions | Best solutions | Back to list |
PRF03ARRAY0103 - ARRAY (SORT) |
Write a program that allows users to enter a numeric array with N elements. The program will sort and display them.
Example 1
How many element of numeric array:5
The value of a[1] is:2
The value of a[2] is:-1
The value of a[3] is:8
The value of a[4] is:3
The value of a[5] is:0
DESC:
5 element of numeric array:
The value of a[1] is:8
The value of a[2] is:3
The value of a[3] is:2
The value of a[4] is:0
The value of a[5] is:-1
Example 2
How many element of numeric array:3
The value of a[1] is:2
The value of a[2] is:1
The value of a[3] is:3
DESC:
3 element of numeric array:
The value of a[1] is:3
The value of a[2] is:2
The value of a[3] is:1
Note by Editorial Board
This program outputs prompts as though it is running in an interactive environment. SPOJ isn't interactive, and you'll get a better idea of what the real output should look like if you run your program in a similar non-interactive environment, such as ideone. I've done this and added the output below to give an alternative view of how the output should be formatted. Note the lack of newlines after the prompts. It looks like the problem setter has chosen the exact judge, so your output must match exactly.
Example
Input: 5 2 -1 8 3 0 Output: How many element of numeric array:The value of a[1] is:The value of a[2] is:The value of a[3] is:The value of a[4] is:The value of a[5] is: DESC: 5 element of numeric array: The value of a[1] is:8 The value of a[2] is:3 The value of a[3] is:2 The value of a[4] is:0 The value of a[5] is:-1
Input: 3 2 1 3 Output: How many element of numeric array:The value of a[1] is:The value of a[2] is:The value of a[3] is: DESC: 3 element of numeric array: The value of a[1] is:3 The value of a[2] is:2 The value of a[3] is:1
Added by: | khanhvh |
Date: | 2020-11-02 |
Time limit: | 1s-10s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |