[365] 2020-12-28_gomap

文档创建者:s7ckTeam
浏览次数:5
最后更新:2025-01-16
2020-12-28_gomap g o   m a p   a F a   a F a   2 0 2 0 - 1 2 - 2 8   # G o l a n g   , 1 6 g o   m a p p y m a p m a p m a p [ s t r i n g ] i n t m a k e m a p m a p [ ] n i l n i l n u l l f u n c   m a i n ( ) {     v a r   m 1   m a p [ s t r i n g ] i n t     m 2   : =   m a k e ( m a p [ s t r i n g ] i n t ,   5 )     f m t . P r i n t l n ( m 1 )     f m t . P r i n t l n ( m 2 ) }
m a p 使 m a k e m a p 访 访 m a p k e y k e y m a p v a l u e i n t i n t 0 i f k e y m a p b o o l b o o l t r u e f a l s e f u n c   m a i n ( ) {     / /   { }     m 1   : =   m a p [ s t r i n g ] i n t { }     m 1 [ " x i a o m i n g " ]   =   2 0     f m t . P r i n t l n ( m 1 )     / /   m a k e , 5     m 2   : =   m a k e ( m a p [ s t r i n g ] i n t ,   5 )     m 2 [ " x i a o h o n g " ]   =   1 8     f m t . P r i n t l n ( m 2 ) } f u n c   m a i n ( ) {     m 1   : =   m a p [ s t r i n g ] i n t { }     m 1 [ " x i a o m i n g " ]   =   2 0     f m t . P r i n t l n ( m 1 [ " x i a o m i n g " ] )   / /   2 0 } f u n c   m a i n ( ) {     m 1   : =   m a p [ s t r i n g ] i n t { }     m 1 [ " x i a o m i n g " ]   =   2 0     v ,   o k   : =   m 1 [ " x i a o h o n g " ]     i f   o k   {         f m t . P r i n t l n ( v )
m a p m a p r a n g e r a n g e m a p k e y v a l u e m a p s l i c e a p p e n d m a p d e l e t e     }   e l s e   {         f m t . P r i n t l n ( " " )   / /       } } f u n c   m a i n ( ) {     m 1   : =   m a p [ s t r i n g ] i n t { }     m 1 [ " x i a o m i n g " ]   =   2 0     m 1 [ " x i a o h o n g " ]   =   1 8     f o r   k e y ,   v a l u e   : =   r a n g e   m 1   {         f m t . P r i n t l n ( k e y ,   v a l u e )     } } f u n c   m a i n ( ) {     m 1   : =   m a p [ s t r i n g ] i n t { }     m 1 [ " x i a o m i n g " ]   =   2 0     m 1 [ " x i a o h o n g " ]   =   1 8     d e l e t e ( m 1 ,   " x i a o m i n g " )     f o r   k e y ,   v a l u e   : =   r a n g e   m 1   {         f m t . P r i n t l n ( k e y ,   v a l u e )     } }
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则