fork download
  1. using static System.Console;
  2.  
  3. public class Program {
  4. public static void Main() {
  5. Write("Digite o nome do rei: " );
  6. while (true) {
  7. var king = ReadLine();
  8. if (king.Length > 0 && king.Length < 21 && char.IsUpper(king[0])) break;
  9. WriteLine("O nome está inválido\nDigite novamente");
  10. }
  11. }
  12. }
  13.  
  14. //https://pt.stackoverflow.com/q/335663/101
Success #stdin #stdout 0.02s 15856KB
stdin
Joao
stdout
Digite o nome do rei: