?? dic.prog
字號:
Using a dictionary to count the number of occurrences of the elements in a sequence of strings, terminated by string ``stop''.\smallskip\#include \<LEDA/dictionary.h\>\smallskipmain()\\$\{$\hspace*{.5cm} dictionary\<string,int\> $D$;\smallskip\hspace*{.5cm} string $s$;\\\hspace*{.5cm} dic\_item $it$;\smallskip\hspace*{.5cm} {\bf while} (cin \>\> $s$)\hspace*{1.5cm} $\{$\ $it = D$.lookup($s$);\\\hspace*{1.85cm} if ($it==nil$) $D$.insert($s,1$);\\\hspace*{1.85cm} else $D$.change\_inf($it$,$D$.inf($it$)+1);\\\hspace*{1.5cm} $\}$\smallskip\hspace*{.5cm} {\bf forall\_items}($it,D$) cout \<\< $D$.key($it$) \<\< `` : " \<\< $D$.inf($it$) \<\< endl;\\\smallskip$\}$\\
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -