Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- Console.Write("Enter string: ");
- string str = Console.ReadLine();
- char [] mas = new char [str.Length];
- int count;
- bool flag = true;
- Console.WriteLine("Символы, встречающиеся в строке один раз:");
- for(int i = 0; i < str.Length; i++)
- {
- count = 0;
- for (int j = 0; j < str.Length; j++)
- {
- if (str[i] == str[j])
- {
- count++;
- }
- }
- if (count == 1)
- {
- flag = false;
- Console.Write(str[i]);
- }
- }
- if (flag) Console.Write("В строке нет символов, повторяющихся один раз.");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement