Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace MultiplicationTable
- {
- class Program
- {
- static void Main(string[] args)
- {
- int num1 = int.Parse(Console.ReadLine());
- int num2 = int.Parse(Console.ReadLine());
- if (num2 < 11)
- {
- for (int i = num2; i < 11; i++)
- {
- Console.WriteLine($"{num1} X {i} = {num1 * i}");
- }
- }
- else
- {
- Console.WriteLine($"{num1} X {num2} = {num1 * num2}");
- }
- }
- }
- }
- Решение с do-while:
- using System;
- namespace MultiplicationTable2
- {
- class Program
- {
- static void Main()
- {
- int num1 = int.Parse(Console.ReadLine());
- int num2 = int.Parse(Console.ReadLine());
- do
- {
- Console.WriteLine($"{num1} X {num2} = {num1 * num2}");
- num2++;
- } while (num2 < 11);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement