Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Numbers
- {
- class Numbers
- {
- static void Main(string[] args)
- {
- int num = int.Parse(Console.ReadLine());
- int a = num / 100;
- int b = num % 100 / 10;
- int c = num % 100 % 10;
- int row = a + b;
- int column = a + c;
- int num2 = num;
- for (int i = 1; i <= row; i++)
- {
- for (int j = 1; j <= column; j++)
- {
- if (num2 % 5 == 0)
- {
- num2 -= a;
- Console.Write("{0} ", num2);
- }
- else if (num2 % 3 == 0)
- {
- num2 -= b;
- Console.Write("{0} ",num2);
- }
- else
- {
- num2 += c;
- Console.Write("{0} ", num2);
- }
- if (j == column)
- {
- Console.WriteLine();
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement