每行显示多少个

public static void PrintValues( IEnumerable myList, int myWidth )  {
 54      int i = myWidth;
 55      foreach ( Object obj in myList ) {
 56         if ( i <= 0 )  {
 57            i = myWidth;
 58            Console.WriteLine();
 59         }

 60         i--;
 61         Console.Write( "{0,8}", obj );
 62      }

 63      Console.WriteLine();
 64   }

posted on 2012-02-20 15:09  雨渐渐  阅读(134)  评论(0编辑  收藏  举报

导航