#!/usr/bin/perl $N = <>; chomp $N; ($A, $B) = split /\s/, $N; chomp $S; for($i=$A ; $i<=$B; $i++){ $t = $i; if($t%3 == 0){ print "$t\n"; }elsif(index($t, "3") != -1){ print "$t\n"; } }