Advertisement
AmirVagapov

Is all "Key" letters in S?

Apr 2nd, 2023 (edited)
644
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.55 KB | None | 0 0
  1. using System;
  2.  
  3. class Program {
  4.  public static int Main() {
  5.      
  6.   Console.Write("Введите строку  : ");
  7.   string S = Console.ReadLine();
  8.   string lt1 = "k", lt2 = "e", lt3 = "y";
  9.   bool a = S.Contains(lt1);
  10.   bool b = S.Contains(lt2);
  11.   bool c = S.Contains(lt3);
  12.  
  13.     if(a && b && c) { Console.WriteLine("Все буквы из словa key встречаются"); }
  14.         else { Console.WriteLine("Не все буквы из словa key встречаются"); }
  15.            
  16.   Console.ReadKey();
  17.   return 0;
  18.  }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement