using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp14
{
internal class Program
{
static void Main(string[] args)
{
bool valid = false;
while (!valid)
{
Console.WriteLine("Enter a string: ");
string sentence = Console.ReadLine();
int length = sentence.Length;
char[] sentence2 = sentence.ToCharArray();
bool isupper = true;
bool notrepeating = true;
int valueascii = 0;
for (int i = 0; i < length; i++)
{
char b = sentence2[i];
if (Char.IsUpper(b) == false)
{
isupper = false;
}
valueascii = valueascii + Convert.ToInt32(b);
}
Array.Sort(sentence2);
for (int i = 0; i < length; i++)
{
if (sentence2[i] == sentence2[i++])
{
notrepeating = false;
}
}
Console.WriteLine(sentence2);
if (length > 4 && length < 8 && isupper && valueascii > 419 && valueascii < 601 && notrepeating)
{
Console.WriteLine("This is between 4 and 8 and is upper and has the correct ascii values and contains no repeating characters");
valid = true;
}
Console.ReadLine();
}
}
}
}