C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

i need help

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Sun Oct 22, 2006 8:36 am    Post subject: i need help Reply with quote



hi,i have a aquestion that i don't know how to compare the smallest and
the largest between five intergers.could anyone help me,thanks.
Back to top
Phlip
Guest





PostPosted: Sun Oct 22, 2006 8:43 am    Post subject: Re: i need help Reply with quote



h168210 wrote:

Quote:
hi,i have a aquestion that i don't know how to compare the smallest and
the largest between five intergers.could anyone help me,thanks.

Sit down with your tutorial and read it, from the front cover, until you are
well past the answer. Do not return to a computer until you do this.
(Especially to post!;)

--
Phlip
http://www.greencheese.us/ZeekLand <-- NOT a blog!!!
Back to top
David Harmon
Guest





PostPosted: Sun Oct 22, 2006 9:10 am    Post subject: Re: i need help Reply with quote



On 21 Oct 2006 20:36:19 -0700 in comp.lang.c++, h168210 (AT) gmail (DOT) com
wrote,
Quote:
hi,i have a aquestion that i don't know how to compare the smallest and
the largest between five intergers.could anyone help me,thanks.

Show the code that you have written. Describe how the result
differs from what you wanted. Ask specific questions.

This issue is covered in Marshall Cline's C++ FAQ. See the topic
"[5.2] How do I get other people to do my homework problem for me?"
It is always good to check the FAQ before posting. You can get the
FAQ at:
http://www.parashift.com/c++-faq-lite/

See the welcome message posted twice per week in comp.lang.c++ under
the subject "Welcome to comp.lang.c++! Read this first." or
available at http://www.slack.net/~shiva/welcome.txt
Back to top
Daniel T.
Guest





PostPosted: Sun Oct 22, 2006 9:10 am    Post subject: Re: i need help Reply with quote

h168210 (AT) gmail (DOT) com wrote:

Quote:
hi,i have a aquestion that i don't know how to compare the smallest and
the largest between five intergers.could anyone help me,thanks.

http://www.sgi.com/tech/stl/max_element.html
http://www.sgi.com/tech/stl/min_element.html

--
There are two things that simply cannot be doubted, logic and perception.
Doubt those, and you no longer have anyone to discuss your doubts with,
nor any ability to discuss them.
Back to top
Jim Langston
Guest





PostPosted: Sun Oct 22, 2006 9:10 am    Post subject: Re: i need help Reply with quote

<h168210 (AT) gmail (DOT) com> wrote in message
news:1161488179.822058.52430 (AT) h48g2000cwc (DOT) googlegroups.com...
Quote:
hi,i have a aquestion that i don't know how to compare the smallest and
the largest between five intergers.could anyone help me,thanks.

Few ways to do it, depending on how you want to go. Simple way is put them
into a sorted contain, and then get the largest and the smallest.

Another way, put them in some type of container (array, vector, etc..) and
use a for loop going through each one comparing if it's smaller or greater
than saved values.

Sounds like a homework question, so I'm not going to give you any code.
Back to top
Salt_Peter
Guest





PostPosted: Sun Oct 22, 2006 9:11 am    Post subject: Re: i need help Reply with quote

h168210 (AT) gmail (DOT) com wrote:
Quote:
hi,i have a aquestion that i don't know how to compare the smallest and
the largest between five intergers.could anyone help me,thanks.

Forget the smallest and the largest of 5 integers.

How do you declare an integer variable and initialize it?
How do you then compare 2 variables?
Show the code.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.