SHARE
TWEET

MultiplyTable/SampleExam

Valantina Jun 12th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace MultiplyTable
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.             int lastDigit = 0;
  11.             int middleDigit = 0;
  12.             int firstNum = 0;
  13.             lastDigit = n / 100;
  14.             n = n % 100;
  15.             middleDigit = n / 10;
  16.             n = n % 10;
  17.             firstNum = n;
  18.             for (int i = 1; i <= firstNum; i++)
  19.             {
  20.                 for (int j = 1; j <= middleDigit; j++)
  21.                 {
  22.                     for (int k = 1; k <= lastDigit; k++)
  23.                     {
  24.                         Console.WriteLine($"{i} * {j} * {k} = {i * j * k};");
  25.                     }
  26.                 }
  27.             }
  28.         }
  29.     }
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top