Hi! :)
I want to print all different elements of sorting array.
input: 10 10 5 4
output: 10 5 4
:-/
Thank you!
a_sd
0
Newbie Poster
Recommended Answers
Jump to PostCould you post your code and post your question in a detail manner
Anyway here's my suggestion according to your i/o,
just loop through the array and make a conditional if a value is already given
Jump to PostPrint out the first number and also store it in an array.
Get the second number and compare it to the array, and if not found in the array, store in array and print out, else don't print out.
Loop around and do again for each additional number.
All 5 Replies
zeroliken
79
Nearly a Posting Virtuoso
MandrewP
60
Junior Poster in Training
a_sd
0
Newbie Poster
ravenous
266
Posting Pro in Training
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.