Demo entry 5993307

sushu

   

Submitted by aipeng on Sep 13, 2016 at 11:07
Language: Perl. Code size: 207 Bytes.

sub function ()
{
  my $x = shift;
  if ($x <= 1)
  {
	   return 0;
  }

  my $f = int(sqrt($x))
  for my $i (2 .. $f)
  {
    if ($x % $i == 0)
    {
      return 0;
    }
  }
  return 1;
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).