Re: Why does it run so long?
- From: Eric Sosman <eric.sosman@xxxxxxx>
- Date: Thu, 01 Sep 2005 13:07:58 -0400
Ed Prochak wrote:
> Michael wrote:
>
>>Hi.
>>
>>Here is my codes, which run too long. It takes about 8 minutes to complete
>>the "for" loop. Why does it run so long? What's wrong?
>>
>>Thanks for any help.
>>
>>Yours sincerely,
>>
>>Michael
>>
>>P.S.:
>>for(i=1; i<=30; i++)
>>{
>>mark:
>>for(j=1; j<=100; j++) x[j]=Random();//Random() will generate a value between
>>0 and 1;
>>if(check(x)==0) goto mark;
>>for(j=1; j<=100; j++) A[i][j]=x[j];
>
> this loop runs 100 times inside a loop that runs 100times,
No; you've got the nesting wrong. (The shoddy
formatting of the code is at least partly to blame.)
--
Eric.Sosman@xxxxxxx
.
- References:
- Why does it run so long?
- From: Michael
- Re: Why does it run so long?
- From: Ed Prochak
- Why does it run so long?
- Prev by Date: Re: Console Screen update - Iteration Count
- Next by Date: Re: while (1) vs. for ( ;; )
- Previous by thread: Re: Why does it run so long?
- Next by thread: Re: Why does it run so long?
- Index(es):
Relevant Pages
|
|