Advertisement
Guest User

06.MultiplyTable

a guest
Jul 1st, 2019
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.94 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _06.MultiplyTable
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.  
  14.             int num = int.Parse(Console.ReadLine());
  15.            
  16.  
  17.             char[] revNum = num.ToString().ToCharArray();
  18.             Array.Reverse(revNum);
  19.             int fL = (int)char.GetNumericValue(revNum[0]);
  20.             int sL = (int)char.GetNumericValue(revNum[1]);
  21.             int tL = (int)char.GetNumericValue(revNum[2]);
  22.             //Console.WriteLine(f);
  23.             for (int f = 1; f <= fL; f ++) {
  24.                 for (int s = 1; s <= sL; s++)
  25.                 {
  26.                     for (int t = 1; t <= tL; t++)
  27.                     {
  28.                         Console.WriteLine($"{f} * {s} * {t} = {f*s*t};");
  29.                     }
  30.                 }
  31.             }
  32.  
  33.         }
  34.  
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement