Advertisement
DaniPasteBin

Untitled

May 28th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _06.StringsAndObjects
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string text1 = Console.ReadLine();
  10.             string text2 = Console.ReadLine();
  11.             object greeting = text1 +" "+ text2;
  12.  
  13.             string strGreeting = Convert.ToString(greeting); //вариант 1
  14.             string strGreeting1 = (string)greeting;          //вариант 2
  15.  
  16.             Console.WriteLine(strGreeting);
  17.             Console.WriteLine(strGreeting1);
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement