Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text;
- namespace DigitsLettersAndOther
- {
- class MainClass
- {
- public static void Main(string[] args)
- {
- string text = Console.ReadLine();
- StringBuilder sbForDigits = new StringBuilder();
- StringBuilder sbForLetters = new StringBuilder();
- StringBuilder sbForOthers = new StringBuilder();
- foreach (var symbol in text)
- {
- if (char.IsDigit(symbol))
- {
- sbForDigits.Append(symbol);
- }
- else if (char.IsLetter(symbol))
- {
- sbForLetters.Append(symbol);
- }
- else
- {
- sbForOthers.Append(symbol);
- }
- }
- Console.WriteLine(sbForDigits);
- Console.WriteLine(sbForLetters);
- Console.WriteLine(sbForOthers);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement