View Single Post
  #4   Spotlight this post!  
Unread 10-01-2007, 17:48
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,562
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Scoring function in C

Your algorithm gives the same results as mine (and I think yours is faster, although I haven't really tested it).

The single cout seems to be unnecessary, and removing it saves someone from having to include iostream (if they aren't already using it).

Also, declaring your variables inside the for construct is only legal in c++ not c.