/
boriscrazy
/
extrapractice
Обзор
Документация
Войти
/
boriscrazy
/
extrapractice
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Program.cs
55 строк
2 KB
boris-ec
create code
29 сен 2025, 18:00
29 сен 2025, 18:00
3251755
Код
Авторство
О чём код?
namespace task1; class Program { static void Main(string[] args) { // ========================= // Expr1. Intercambiar valores // ========================= int a = 5; int b = 10; // Con variable temporal int temp = a; a = b; b = temp; Console.WriteLine($"Expr1 (con temp): a = {a}, b = {b}"); // // Sin variable temporal (suma/resta) // a = 5; // b = 10; // a = a + b; // b = a - b; // a = a - b; // Console.WriteLine($"Expr1 (sin temp): a = {a}, b = {b}"); // // ========================= // // Expr2. Invertir número de 3 cifras // // =========================Or // int n = 123; // int centenas = n / 100; // int decenas = (n / 10) % 10; // int unidades = n % 10; // int invertido = unidades * 100 + decenas * 10 + centenas; // Console.WriteLine($"Expr2: {invertido}"); // // ========================= // // Expr3. Ángulo entre agujas del reloj // // ========================= // int H = 20; // int angulo = (30 * H) % 360; // if (angulo > 180) // angulo = 360 - angulo; // Console.WriteLine($"Expr3: {angulo} grados"); // // ========================= // // Expr4. Números menores que N divisibles por X o Y // // ========================= // int N = 100; // int X = 3; // int Y = 5; // int count = (N - 1) / X + (N - 1) / Y - (N - 1) / MCM(X, Y); // Console.WriteLine($"Expr4: {count}"); } }