Advertisement
Sephinroth

prac 2 ex 3

Sep 15th, 2019
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace _2._3
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             Console.Write("Введите число Y = ");
  13.             int y = int.Parse(Console.ReadLine());
  14.             y /= 2;
  15.             string xStr = y.ToString();
  16.             char xChr = xStr[xStr.Length-1];
  17.             xStr = xStr.Remove(xStr.Length - 1);
  18.             Console.Write("Число X = " + xChr + xStr);
  19.             Console.ReadKey();
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement