?? d_array.prog
字號:
{\bf Program 1}:Using a dictionary array to count the number of occurences of the elements in a sequence of strings.\bigskip\#include $<$LEDA/d\_array.h$>$main()$\{$\hspace*{.5cm}d\_array\<string,int\> $N(0)$;\hspace*{.5cm}string $s$;\smallskip\hspace*{.5cm}{\bf while} (cin \>\> $s$) $N[s]++$;\smallskip\hspace*{.5cm}{\bf forall\_defined}($s,N$) cout \<\< $s$ \<\< `` " \<\< $N[s]$ \<\< endl;\smallskip $\}$\\\bigskip{\bf Program 2}:Using a d\_array to realize an english/german dictionary.\bigskip\#include $<$LEDA/d\_array.h$>$main()$\{$\smallskip\hspace*{.5cm}d\_array\<string,string\> $trans$;\smallskip\hspace*{.5cm}$trans$[``hello"]\hspace{.13cm}= ``hallo";\\\hspace*{.5cm}$trans$[``world"]= ``Welt";\\\hspace*{.5cm}$trans$[``book"]\hspace{.13cm}= ``Buch";\\\hspace*{.5cm}$trans$[``key"]\hspace{.37cm}= ``Schluessel";\smallskip\hspace*{.5cm}string $s$;\hspace*{.5cm}{\bf forall\_defined}($s,trans$) cout \<\< $s$ \<\< `` " \<\< $trans[s]$ \<\< endl;\smallskip$\}$
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -