by kratzers@[EMAIL PROTECTED]
(Stephen Kratzer)
May 5, 2008 at 11:18 AM
On Monday 05 May 2008 09:22:51 Rodrigo Tavares wrote:
> Hello,
>
> I need create a square using a single number, but I don't know how to
> create the sides.
>
> I have to create this:
>
> ****
> * *
> * *
> ****
>
> My code is below :
>
> print "Enter with number:";
> chomp ($number =3D <STDIN>);
>
> my @[EMAIL PROTECTED]
=3D ();
>
> $cont =3D 0;
>
> while ($numero > $cont)
> {
> $array[$cont]=3D"*";
> $cont++;
> }
>
> print @[EMAIL PROTECTED]
> print "\n";
> print @[EMAIL PROTECTED]
> print "\n";
>
> How I can to show the arrar like sides ?
>
> []'s
>
> Faria
>
>
> Abra sua conta no Yahoo! Mail, o =FAnico sem limite de espa=E7o
para
> armazenamento! http://br.mail.yahoo.com/
for (1..$n) {
if ($_ =3D=3D 1 || $_ =3D=3D $n) {
print "*" x $n, "\n";
}
else {
print "*", " " x ($n - 2), "*\n";
}
}