Advertisement
NikaBang

Работа с строкой

May 12th, 2024
429
0
18 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.61 KB | None | 0 0
  1. using System;
  2.  
  3. internal class Program
  4. {
  5.     static void Main(string[] args)
  6.     {
  7.         string firstName;
  8.         string lastName;
  9.         int age;
  10.  
  11.         Console.Write("Напишите ваше имя: ");
  12.         firstName = Console.ReadLine();
  13.  
  14.         Console.Write("Напишите вашу фамилию: ");
  15.         lastName = Console.ReadLine();
  16.  
  17.         Console.Write("Сколько вам лет: ");
  18.         age = Convert.ToInt32(Console.ReadLine());
  19.  
  20.         Console.WriteLine($"Вас завут: {firstName} {lastName}, вам {age} лет.");
  21.         Console.ReadKey();
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement