Yeah, I'll have a crack at it ...
01 sub standarization { # was standarization(void) 02 my(i,j,k); 03 for (i=1; i<=10; i++) # where does "for" end? { 04 if (d[i][0]!=0) # where does "if" end? { 05 for (k=1; k<24; k++) 06 { 07 d[0][k] += d[i][k]; 08 d[i][k] /= d[i][0]; 09 } } //end of if line 4 } //end of for line 3 10 11 for (i=9; i<=18; i++) # where does "for" end? { 12 if (psb[i][0]!=0) # where does "if" end? { 13 for (k=11; k<=BUST; k++) 14 { # new 15 psb[i][k] /= psb[i][0]; 16 } # new } //end of if line 12 } // end of for line 11 17 18 for (j=1; j<=10; j++) # where does "for" end? { 19 if (s[j][0][0]!=0) { 20 for (i=12; i<=18; i++) { 21 if (s[j][i][0]!=0) # where does "if" end? { 22 for (k=12; k<=BUST; k++) 23 { # new 24 s[j][i][k] /= s[j][i][0]; 25 } # new } // end of if line 21 26 27 if (s[j+10][i][0]!=0) # where does "if" end? { 28 for (k=12; k<=BUST; k++) 29 { # new 30 s[j+10][i][k] /= s[j+10][i][0]; 31 } # new 32 s[j][i][0] /= s[j][0][0]; 33 s[j][i][1] /= s[j][0][0]; 34 s[j+10][i][0] /= s[j][0][0]; 35 s[j+10][i][1] /= s[j][0][0]; } // end of if line 27 36 } # end "for" line 20 37 38 for (k=17; k<=BUST; k++) { 39 s[j][0][k] /= s[j][0][0]; 40 s[j+10][0][k] /= s[j][0][0]; 41 } 42 } # end of "if" line 19 } // end of for line 18 43 } # end of sub
No guarantee I got it right, however :-)

Cheers,
Rob

In reply to Re: Convert loop and if constructs from C to Perl by syphilis
in thread Convert loop and if constructs from C to Perl by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.