fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. for(int i = 0; i < 1;)
  8. {
  9. Console.WriteLine("Введите число от 1 до 10.");
  10.  
  11. string input = Console.ReadLine();
  12. int number;
  13. bool conv = Int32.TryParse(input, out number);
  14.  
  15. if(conv)
  16. {
  17. if(number >= 1 && number <= 10)
  18. {
  19. i = 1;
  20. Console.WriteLine("Введено верно.");
  21. }
  22. }
  23. }
  24. }
  25. }
Success #stdin #stdout 0.02s 14848KB
stdin
15
d
12
as1
5
stdout
Введите число от 1 до 10.
Введите число от 1 до 10.
Введите число от 1 до 10.
Введите число от 1 до 10.
Введите число от 1 до 10.
Введено верно.