Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication2
- {
- class Program
- {
- static void Main(string[] args)
- {
- String firstStr = "_)(^%*))&%*";
- String endStr = "";
- int n = 0;
- for (int i = 0; i < firstStr.Length; i++)
- {
- if ('a' <= firstStr[i] && firstStr[i] <= 'z' || 'A' <= firstStr[i] && firstStr[i] <= 'Z')
- {
- endStr += firstStr[i];
- n++;
- }
- }
- if (n > 0) {
- Console.WriteLine("исходная строка: " + firstStr);
- Console.WriteLine("преобразованная строка: " + endStr);
- }
- else
- Console.WriteLine("Пустая строка или отсутствуют буквы алфавита!");
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement