Re: a problem in my program in pascal
gilevgi@xxxxxxxxx rašė:
I want to write the pattern " for i:=1 to a[i] do" n times (n is
variable), that is,
for b[1]:=1 to a[1] do
for b[2]:=1 to a[2] do
for b[3]:=1 to a[3] do
for b[4]:=1 to a[4] do
.........
..........
.........
for b[n]:=1 to a[n] do
something here.
in this writing n is a variable. therefore I can not write what i want.
can you say how can i write the above structure using "repeat-until" or
"while" patterns?
thanks in advance.
i think need:
var i, ii:integer;
begin
ii:=1;
for i:=1 to length(a) do
ii=ii*(a[i]-b[i]);
for i:=1 to ii do
something here
try to change code by you
.
Relevant Pages
- Re: Mariners Compass - book recommendation
... she was writing this one (and spent a week at a retreat with her last ... Mariner's Compass Quilts: Setting a New Course New Process, New Patterns, ... I think the instructions are great and the patterns are good too. ... (rec.crafts.textiles.quilting) - Re: Oh Hello
... > Like I remember any of the diagramming I did in eighth grade... ... diagramming has no demonstrable effect on writing skills. ... grammar in the context of writing is extensive reading. ... using that knowledge of those patterns in one's own writing. ... (rec.arts.anime.misc) - Re: Help identifying job (family history!)
... It gets a little easier after a while, you start to recognise the patterns ... of writing. ... I was being a little bit impatient that day ... and decided I'd rope in some help from the more experienced in here! ... (uk.people.silversurfers) - Re: Yanomami Written Language or the Lack Thereof
... their hunting and eating patterns?" ... You're insisting that the Yanomami have writing, but you're asking a bunch of questions that no matter what the answers are wouldn't shed any light on the question of whether they have writing. ... Where do you get the idea that Usenet threads are owned by anybody, and that you have any authority over who does and doesn't participate? ... If I wanted to go to the rain forest, I could go to the rain forest. ... (sci.lang) - Re: program design
... The article Richard refers to is one that I am writing and if you want ... at least a number of these patterns in Fortran 90/95. ... environment Fortran is usually used, ... (comp.lang.fortran) |
|