| | |
Finding Positon of characters
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2007
Posts: 3
Reputation:
Solved Threads: 0
I want to writer a program in which i input an array?
let the array i entered is :
4
1
2
3
The prigram can take values and find the positions of the character in the array such that the smallest on 0 position and so on.
The result of the array will be if i start array from 0
1
2
3
0
that means it will find the position of the numbers in the array and display it on the screen
Onlt the position of the numbers is specifying and the position of the numbers.
Any one to solve it.
let the array i entered is :
4
1
2
3
The prigram can take values and find the positions of the character in the array such that the smallest on 0 position and so on.
The result of the array will be if i start array from 0
1
2
3
0
that means it will find the position of the numbers in the array and display it on the screen
Onlt the position of the numbers is specifying and the position of the numbers.
Any one to solve it.
•
•
Join Date: May 2008
Posts: 630
Reputation:
Solved Threads: 101
If the array entered was: I think the output should be:
Does it look like I understood the what the program is supposed to do?
I will not just solve your problem. I will help YOU solve your problem.
If you're writing a program, it will need to do the following:
1) Accept the user input for the array
2) Generate the output array
3) Display the output array
Have you written anything yet?
If so, which parts have you addressed?
C++ Syntax (Toggle Plain Text)
40 20 10 30
C++ Syntax (Toggle Plain Text)
2 1 3 0
Does it look like I understood the what the program is supposed to do?
I will not just solve your problem. I will help YOU solve your problem.
If you're writing a program, it will need to do the following:
1) Accept the user input for the array
2) Generate the output array
3) Display the output array
Have you written anything yet?
If so, which parts have you addressed?
•
•
Join Date: Jun 2008
Posts: 182
Reputation:
Solved Threads: 18
I think that the resulting array is the list of positions that the elements of the first array occupied before being sorted.
For example the min elements of the first array is 10 and it was in position 2, then we have 20 at position 1, 30 at position 3 and 40 at position 0, so (40, 20, 10, 30) -> (0, 1, 2, 3) and (10, 20, 30, 40) -> (2, 1, 3, 0)
Someone please correct me if I'm wrong.
EDIT: I didn't see the other thread - why do some people think so often that quantity necessarily means quality?
For example the min elements of the first array is 10 and it was in position 2, then we have 20 at position 1, 30 at position 3 and 40 at position 0, so (40, 20, 10, 30) -> (0, 1, 2, 3) and (10, 20, 30, 40) -> (2, 1, 3, 0)
Someone please correct me if I'm wrong.
EDIT: I didn't see the other thread - why do some people think so often that quantity necessarily means quality?
Last edited by mrboolf; Dec 2nd, 2008 at 1:21 pm.
![]() |
Other Threads in the C++ Forum
- Previous Thread: C++ Segement Fault on Unix
- Next Thread: Help, Im trying to implement my own strcpy
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays beginner binary bmp c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete desktop directshow dll download dynamic encryption error file forms fstream function functions game givemetehcodez google graph gui iamthwee ifstream input int java lib library lines linkedlist linker linux loop looping loops map math matrix memory microsoft newbie news number output pointer problem program programming project python random read recursion recursive reference return string strings struct studio system temperature template templates test text text-file tree unix url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets






