Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ABC033
  4. {
  5. public class A
  6. {
  7. public static void Main(string[] args)
  8. {
  9. var input = Console.ReadLine();
  10. Console.WriteLine(checker(input) ? "SAME" : "DIFFERENT");
  11. }
  12.  
  13. public static bool checker(string input)
  14. {
  15. char prev = input[0];
  16. foreach (var c in input)
  17. {
  18. if (prev != c)
  19. {
  20. return false;
  21. }
  22. prev = c;
  23. }
  24. return true;
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement