Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace _01._Vet_Clinic;
- class Program
- {
- static void Main(string[] args)
- {
- string text = Console.ReadLine(); //"Agd#53Dfg^&4F53"
- string digitsText = ""; //съхраняваме всички символи, които са цифри
- string lettersText = ""; //съхраняваме всички символи, които са букви
- string othersText = ""; //съхраняваме всички останали символи
- foreach (char symbol in text) //"Agd#53Dfg^&4F53"
- {
- if (char.IsDigit(symbol))
- {
- digitsText += symbol;
- }
- else if (char.IsLetter(symbol))
- {
- lettersText += symbol;
- }
- else
- {
- othersText += symbol;
- }
- }
- Console.WriteLine(digitsText);
- Console.WriteLine(lettersText);
- Console.WriteLine(othersText);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement