Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication22
  7. {
  8. class Program
  9. {
  10. static bool EsteVocala(char s)
  11. {
  12. if ((s == 'a') || (s == 'e') || (s == 'i') || (s == 'o') || (s == 'u'))
  13. return true;
  14. else return false;
  15.  
  16. }
  17. static void Main(string[] args)
  18. {
  19. string s1=Console.ReadLine(), s2=Console.ReadLine();
  20. if (s1.Length == s2.Length)
  21. {
  22. bool text=true;
  23. for (int i = 0; i < s1.Length; i++)
  24. {
  25. if (((EsteVocala(s1[i])) && (!EsteVocala(s2[i]))) || ((!EsteVocala(s1[i])) && (EsteVocala(s2[i]))))
  26. text = false;
  27. }
  28. if (text)
  29. Console.WriteLine("Cuvintele au aceeasi textura.");
  30. else Console.WriteLine("Cuvintele nu au aceeasi textura.");
  31. }
  32. else Console.WriteLine("Cuvintele nu au aceeasi textura.");
  33. Console.ReadLine();
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement