Advertisement
Guest User

Untitled

a guest
Nov 16th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Електронно_съобщение
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string a = Console.ReadLine();
  14. char[] b = a.ToLower().ToCharArray();
  15.  
  16.  
  17.  
  18. int count = 0;
  19. int countMax = 0;
  20.  
  21. for (int i = 0; i < b.Length; i++)
  22. {
  23.  
  24.  
  25. char z = b[i];
  26.  
  27.  
  28.  
  29. if (
  30. z == 'a' || z == 'b' || z == 'c' || z == 'd' || z == 'e' || z == 'f' || z == 'g' || z == 'h' || z == 'i'
  31. || z == 'j' || z == 'k' || z == 'l' || z == 'm' || z == 'n' || z == 'o' || z == 'p' || z == 'r' || z == 'q' ||
  32. z == 's' || z == 't' || z == 'u' || z == 'v' || z == 'w' || z == 'x' || z == 'y' || z == 'Z' || z == '0'
  33. || z == '1' || z == '2' || z == '3' || z == '4' || z == '5' || z == '6' || z == '7' || z == '8' || z == '9' || z == '.' || z == ' ' ||
  34. z == null)
  35. {
  36. count = 0;
  37. }
  38.  
  39. if (
  40. z != 'a' && z != 'b' && z != 'c' && z != 'd' && z != 'e' && z != 'f' && z != 'g' && z != 'h' && z != 'i'
  41. && z != 'j' && z != 'k' && z != 'l' && z != 'm' && z != 'n' && z != 'o' && z != 'p' && z != 'r' && z != 'q' &&
  42. z != 's' && z != 't' && z != 'u' && z != 'v' && z != 'w' && z != 'x' && z != 'y' && z != 'Z' && z != '0'
  43. && z != '1' && z != '2' && z != '3' && z != '4' && z != '5' && z != '6' && z != '7' && z != '8' && z != '9' && z != '.' && z != ' ')
  44. {
  45. count++;
  46. }
  47.  
  48.  
  49. if (countMax <= count)
  50. {
  51. countMax = count;
  52. }
  53.  
  54.  
  55. }
  56. Console.WriteLine(countMax);
  57.  
  58. }
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement