Advertisement
Serby__

1.III.12

Sep 16th, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.83 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp1
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             Console.Write("Введите X=");
  10.             int n = int.Parse(Console.ReadLine());
  11.            
  12.             int a = 0;
  13.             while(n != 0)
  14.             {
  15.                 a *= 10;
  16.                 a += n % 10;
  17.                 n = n / 10;
  18.                
  19.             }
  20.             int b = 0;
  21.             n = a;
  22.             while (n != 0)
  23.                 {
  24.                     b *= 10;
  25.                     b += n % 10;
  26.                     n = n / 10;
  27.  
  28.                 }
  29.             Console.Write("Введите Y=");
  30.             Console.Write(a);
  31.             Console.Write("\n Введите X=");
  32.             Console.Write(b);
  33.             Console.ReadLine();
  34.  
  35.  
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement