Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int ReadInt(string line, Predicate<int> pr)
- {
- int x; do
- {
- Console.Write(line);
- } while (!int.TryParse(Console.ReadLine(), out x) || !pr(x));
- return x;
- }
- int n = ReadInt("N= ", x => (x > 0) & (x < 25));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement