Created
May 24, 2026 15:44
-
-
Save smah-beep/d7bdd881a40b4cbbec7d29ea28c3e4df to your computer and use it in GitHub Desktop.
ДЗ: Перестановка местами значений
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) | |
| { | |
| int ageDad = 10; | |
| int ageSon = 42; | |
| Console.WriteLine($"Возраст отца {ageDad}, возрат сына {ageSon}"); | |
| Console.WriteLine("Данные перепутаны, нужно поменять их местами"); | |
| int age = ageSon; | |
| ageSon = ageDad; | |
| ageDad = age; | |
| Console.WriteLine($"Возраст отца {ageDad}, возрат сына {ageSon}"); | |
| Console.WriteLine("Другое дело!"); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment