![]() |
Quote:
Anyways, looking at your previous post, it looks like your algorithm is wrong in the second half. There should only be 6 'print' statements b/c there are only 6 possible ways to arrange the names (which you have listed out) assuming the names can't be exactly the same as each other. So your algorithm should be If name1 before name2 ..if name2 before name3 ....print "name1, name2, name3" ..elif name1 before name3 ....print "name1, name3, name2" ..else ....print "name3, name1, name2" else //at this point, name2 is before name1 ..if name3 before name2 ....print "name3, name 2, name1" ..elif name3 before name1 ....print "name2, name3, name1" ..else ....print "name2, name1, name3" |
Quote:
im not majoring in cmpt this is just an elective. |
Quote:
Suppose, a[] = Duck b[] = Dick Compare the a[0] to b[0], if they are equal, then compare a[1] b[1]. if b[1]<a[1] then ouput dick, duck. it gets real nasty when you have 3 words, thats why we use the built in language functions :D |
Quote:
|
All times are GMT -8. The time now is 02:48 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
SEO by vBSEO ©2011, Crawlability, Inc.
Revscene.net cannot be held accountable for the actions of its members nor does the opinions of the members represent that of Revscene.net