Internet search engine giant, such as Google accepts web pages around the world and classify them, creating a huge database
- برمجة بي اتش بي
- 2021-09-08
- mhanasmh00489829403
الأجوبة
<?php
$stdin = trim(fgets(STDIN));
echo "Original string: ".$stdin;
$words = preg_split("/[\s,\.]/", $stdin);
$compWords = array();
for ($i = 0; $i < count($words); $i++) {
if (strlen($words[$i]) > 2 && strlen($words[$i]) < 7) {
$compWords[] = $words[$i];
}
}
echo "\nWords of 3 to 6 characters length: ";
print implode(' ', $compWords) . PHP_EOL;
?>
Sample Input:
The quick brown fox
Sample Output:
Original string: The quick brown fox Words of 3 to 6 characters length: The quick brown fox
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال