Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save smah-beep/70daa5e997ed179fea7e2463f49a6c1d to your computer and use it in GitHub Desktop.

Select an option

Save smah-beep/70daa5e997ed179fea7e2463f49a6c1d to your computer and use it in GitHub Desktop.
ДЗ: Работа со строками
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _DZ_
{
internal class Program
{
static void Main(string[] args)
{
string name;
string month;
int age;
int dateMonth;
int yearBirth;
string fruit;
string vegetable;
string season;
Console.Write("Назовите ваше имя: ");
name = Console.ReadLine();
Console.Write("Введите ваш возраст: ");
age = Convert.ToInt32(Console.ReadLine());
Console.Write("Введите год вашего рождения: ");
yearBirth = Convert.ToInt32(Console.ReadLine());
Console.Write("Введите месяц вашего рождения (в формате 01, 02, ..., 12): ");
month = Console.ReadLine();
Console.Write("Назовите день вашего рождения: ");
dateMonth = Convert.ToInt32(Console.ReadLine());
Console.Write("Назовите ваш любимый фрукт: ");
fruit = Console.ReadLine();
Console.Write("Назовите ваш любимый овощ: ");
vegetable = Console.ReadLine();
Console.Write("Назовите ваше любимое время года: ");
season = Console.ReadLine();
Console.WriteLine("Вот некоторая информация о вас: ");
Console.WriteLine($"Вас зовут {name}, сейчас вам {age}, вы родились {dateMonth}.{month}.{yearBirth}.");
Console.WriteLine($"Вы любите {fruit} и {vegetable}, ваше любимое время года {season}");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment