Advertisement
Dikov

Untitled

Mar 10th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 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 P04
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13.  
  14. double n = double.Parse(Console.ReadLine());
  15.  
  16. double chisla = 0;
  17. double glavniBukvi = 0;
  18. double malkiBukvi = 0;
  19. double simvoli = 0;
  20.  
  21. for (int i = 0; i < n; i++)
  22. {
  23. char m = char.Parse(Console.ReadLine());
  24.  
  25. if (char.IsNumber(m))
  26. {
  27. chisla += m;
  28. }
  29. if (m >= 65 && m <= 90)
  30. {
  31. glavniBukvi += m;
  32. }
  33. if (m >= 97 && m <= 123)
  34. {
  35. malkiBukvi += m;
  36. }
  37. if (char.IsSymbol(m))
  38. {
  39. simvoli += m;
  40. }
  41. }
  42. Console.WriteLine(chisla);
  43. Console.WriteLine(glavniBukvi);
  44. Console.WriteLine(malkiBukvi);
  45. Console.WriteLine(simvoli);
  46. }
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement