Advertisement
Guest User

Untitled

a guest
May 30th, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 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 question_2
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string a = Console.ReadLine();
  14. int length = a.Length;
  15. int count = 0;
  16. for (int i = 0; i < length; i++)
  17. {
  18. if (char.IsLower(a[i]))
  19. {
  20. bool enterbefore = false;
  21. for (int k = 1; k <= i;k++)
  22. {
  23.  
  24. if (a[i] == a[k])
  25. {
  26. break;
  27. enterbefore = true;
  28. }
  29. }
  30. if (!enterbefore)
  31. {
  32. count++;
  33. }
  34. }
  35. }
  36.  
  37. Console.WriteLine("The Answer is "+count);
  38. Console.ReadLine();
  39. }
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement