⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 程嶏清单4-1.txt

📁 < linux网络编程工具>>配套源码
💻 TXT
字号:
# This program finds the Capitalized words
while ($inputline = <STDIN>) {
   while ($inputline =~ /\b[A-Z]\S+/g) {
       $word = $&;
       $word =~ s/[;.,:-]$//;        #   remove punctuation
       for ($count = 1; $count <= @wordlist; $count++) {
           $found = 0;
           if ($wordlist[$count-1] eq $word) {
               $found = 1;
              $wordcount[$count-1] += 1;
             last;
          }
      }
      if ($found == 0) {
          $oldlength = @wordlist;
        $wordlist[$oldlength] = $word;
        $wordcount[$oldlength] = 1;
     }
  }
}
print ("Capitalized words and number of occurrences:\n");
for ($count = 1; $count <= @wordlist; $count++) {
   print ("$wordlist[$count-1]: $wordcount[$count-1]\n");
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -