using System; public class Test { public static void Main() { int[] second = new[] {0,0,0,0,0}; bool finish = false; do { for (int i = 0 ; i != 5 ; i++) { Console.WriteLine("{0} {1}", i+1, second[i]+1); } Console.WriteLine(); int p = 0; do { second[p]++; if (second[p] == 5) { second[p] = 0; p++; } else { break; } } while (p != 5); if (p == 5) break; } while (true); } }