Advertisement
Spocoman

06. Concatenate Data

Aug 21st, 2024
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.36 KB | None | 0 0
  1. namespace ConcatenateData
  2. {
  3.     class Program
  4.     {
  5.         static void Main(string[] args)
  6.         {
  7.             string firstName = Console.ReadLine();
  8.             string lastName = Console.ReadLine();
  9.             int age = int.Parse(Console.ReadLine());    
  10.             string town = Console.ReadLine();
  11.  
  12.             Console.WriteLine("You are " + firstName + ' ' + lastName + ", a " + age + "-years old person from " + town + '.');
  13.         }
  14.     }
  15. }
  16.  
  17. ИЛИ:
  18.  
  19. namespace ConcatenateData
  20. {
  21.     class Program
  22.     {
  23.         static void Main(string[] args)
  24.         {
  25.             string firstName = Console.ReadLine();
  26.             string lastName = Console.ReadLine();
  27.             int age = int.Parse(Console.ReadLine());    
  28.             string town = Console.ReadLine();
  29.  
  30.             Console.WriteLine($"You are {firstName} {lastName}, a {age}-years old person from {town}.");
  31.         }
  32.     }
  33. }
  34.  
  35. ИЛИ:
  36.  
  37. namespace ConcatenateData
  38. {
  39.     class Program
  40.     {
  41.         static void Main(string[] args)
  42.         {
  43.             string firstName = Console.ReadLine();
  44.             string lastName = Console.ReadLine();
  45.             int age = int.Parse(Console.ReadLine());    
  46.             string town = Console.ReadLine();
  47.  
  48.             Console.WriteLine("You are {0} {1}, a {2}-years old person from {3}.", firstName, lastName, age, town);
  49.         }
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement