Computer Science Canada

Problem solving

Author:  someguy123 [ Tue Jan 30, 2007 10:25 pm ]
Post subject:  Problem solving

http://www.cemc.uwaterloo.ca/ccc/2006/junior.pdf

question number 2 on it


well here is the problem

is there anyway to set up 2 "for" statement at once like

for i : 1 .. x
for j : 1 .. y
if i + j = 10 then
c := c + 1
else
c := c + 0
end if
end for
end for

well of course i no this cant be done in turing, but is there anything i can do that will be the same idea just done differnetly?

Author:  Clayton [ Tue Jan 30, 2007 11:06 pm ]
Post subject:  Re: Problem solving

let me give you a hint: have you tried running the code yet?

Author:  someguy123 [ Wed Jan 31, 2007 7:36 am ]
Post subject:  Re: Problem solving

wow b4 i put this

if i + j := 10 then

and now i changed to

if i + j = 10 then

i must have been tired could think straight thx! lol[/quote]


: