Advertisement
Macrovision

Untitled

Jun 27th, 2022
844
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 KB | None
  1. static void Bracket(char[] Text)
  2. {
  3.     var Pharentesis = (Text[0].Equals('(') && Text[1].Equals(')')) ? ":) yes" : ":( No";
  4.     var Corchetes = (Text[0].Equals('[') && Text[1].Equals(']')) ? ":) yes" : ":( No";
  5.     var Brackets = (Text[0].Equals('{') && Text[1].Equals('}')) ? ":) yes" : ":( No";
  6.     Console.WriteLine("\n() " + Pharentesis + "\n[] " + Corchetes + "\n{} " + Brackets + "\n");
  7. }
  8.  
  9. while (true)
  10. {
  11.     Bracket(Console.ReadLine().ToCharArray());
  12. }
Advertisement
RAW Paste Data Copied
Advertisement