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;
- namespace ConsoleApplication2
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Введите сообщение: ");
- string str = Console.ReadLine();
- int pos_st = 0, pos_end;
- for (int i = 0; i < str.Length; i++)
- if (!Char.IsLetterOrDigit(str[i]) || i == str.Length - 1)
- {
- pos_end = i;
- string tmp = str.Substring(pos_st, pos_end - pos_st+1);
- pos_st = pos_end+1;
- if (Char.IsUpper(tmp[0]))
- Console.WriteLine(tmp);
- }
- /*
- char x = '+';
- Console.WriteLine((int)x);*/
- Console.ReadKey();
- }
- }
- }
- // 97-122 — буквы
- // 65-90
- // 48-57 — цифры
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement