Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace CheckNumbers
- {
- class Program
- {
- static void Main(string[] args)
- {
- for (int countM = 10; countM < 100; countM++) // Въртим цикъм за всички двуцифрени М числа от 10 до 99
- {
- for (int countN = 10; countN <= 100; countN++) // Въртим цикъм за всички двуцифрени N числа от 10 до 99
- {
- int countA = (countM % 10) * 10 + (countM / 10); // Вземаме последната цифра от countM и я умножаваме по 10 след това я събираме с първата получена при целочислено деление
- int countB = (countN % 10) * 10 + (countN / 10);
- if ((countM * countN) == (countA * countB)) // Ако условието ни е вярно
- {
- Console.WriteLine($"{countM} * {countN} == {countA} * {countB}"); // Принтираме
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement