Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Купа
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- var oneN = n / 100 % 10;
- var twoN = n / 10 % 10;
- var threeN = n % 10;
- for (int a = 1; a <= threeN; a++)
- {
- for (int b = 1; b <= twoN; b++)
- {
- for (int c = 1; c <= oneN; c++)
- {
- var sum = a * b * c;
- Console.WriteLine($"{a} * {b} * {c} = {sum};");
- }
- }
- }
- }
- }
- }
- // Таблица за умножение
- // 222
- // 1 * 1 * 1 = 1;
- // 1 * 1 * 2 = 2;
- // 1 * 2 * 1 = 2;
- // 1 * 2 * 2 = 4;
- // 2 * 1 * 1 = 2;
- // 2 * 1 * 2 = 4;
- // 2 * 2 * 1 = 4;
- // 2 * 2 * 2 = 8;
Advertisement
Add Comment
Please, Sign In to add comment