View Single Post
Old 02-20-2006, 11:42 AM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,721
redhead is on a distinguished road
Here is some pseudo code for that
Code:
Initiate a counter for input as beeing 0 (i_counter)
Initiate a counter for target as beeing 0 (t_counter)
Have a dynamicaly groving array holding inputted values
while user will provide value
     ask the user for a value
     if one is pressented
         store in your array
         add 1 to i_counter
Ask user for target value
while i_counter >= 0
    if array value at i_counter possition ==  target
        add 1 to t_counter
    subtract one from i_counter
print out t_counter
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote