Advertisement
IngisKahn

answer

Jan 19th, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.30 KB | None | 0 0
  1. static void P(int x, int y, string s)
  2.         {
  3.             if (x + y == 0)
  4.             {
  5.                Console.WriteLine(s);
  6.                 return;
  7.             }
  8.             if (x>0)
  9.                 P(x - 1, y, s + "1");
  10.             if (y>0)
  11.                 P(x, y - 1, s + "0");
  12.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement