Advertisement
Spocoman

05. Greeting by Name

Aug 21st, 2024
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.70 KB | None | 0 0
  1. namespace GreetingByName
  2. {
  3.     class Program
  4.     {
  5.         static void Main(string[] args)
  6.         {
  7.             string name = Console.ReadLine();
  8.  
  9.             Console.WriteLine("Hello, " + name + '!');
  10.         }
  11.     }
  12. }
  13.  
  14. ИЛИ:
  15.  
  16. namespace GreetingByName
  17. {
  18.     class Program
  19.     {
  20.         static void Main(string[] args)
  21.         {
  22.             string name = Console.ReadLine();
  23.  
  24.             Console.WriteLine($"Hello, {name}!");
  25.         }
  26.     }
  27. }
  28.  
  29. ИЛИ:
  30.  
  31. namespace GreetingByName
  32. {
  33.     class Program
  34.     {
  35.         static void Main(string[] args)
  36.         {
  37.             string name = Console.ReadLine();
  38.  
  39.             Console.WriteLine("Hello, {0}!", name);
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement