Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Re: contests exercises (slightly OT)

Reply
Thread Tools

Re: contests exercises (slightly OT)

 
 
Chad
Guest
Posts: n/a
 
      11-29-2010
On Nov 29, 9:54*am, superpollo <superpo...@tznvy.pbz> wrote:
> greetings!
>
> if you are familiar with sites likewww.spoj.pl(for instance), you will
> notice that the emphasis is on the efficiency and correctness of the
> algorithm, given a certain input format for granted. example:
>
> ==========
> 1. Life, the Universe, and Everything
> Problem code: TEST
>
> Your program is to use the brute-force approach in order to find the
> Answer to Life, the Universe, and Everything. More precisely... rewrite
> small numbers from input to output. Stop processing input after reading
> in the number 42. All numbers at input are integers of one or two digits.
>
> Example
>
> Input:
> 1
> 2
> 88
> 42
> 99
>
> Output:
> 1
> 2
> 88
> ==========
>
> as you can see, the input file format is given for granted.
>
> since lot of discussion here on clc are debated around the issue of
> "always be careful of user input" (for issues such as the buffer
> overflow attack), it looks like it is a prefeerd topic here, so i would
> like to know you opinion about the teaching value of such contest, which
> seem to ignore good programming habits (at least some of them).
>
> best regards


Okay, it took me an entire minute to come up with a solution to this
problem.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Photo Contests Photog Digital Photography 0 01-10-2006 11:20 PM
2 DVD contests at dvddude.net fsdstudio@gmail.com DVD Video 0 06-18-2005 11:18 PM
"Malevolence" Contests - Canadian Residents Only Harsol DVD Video 0 04-15-2005 09:01 AM
Any Good Photo Contests Jerry Digital Photography 1 07-19-2004 04:17 AM
Microsoft contests David MCSD 5 06-27-2004 03:10 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57