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 N = int.Parse(Console.ReadLine());
- int a = N % 10;
- int b = (N / 10) % 10;
- int c = N / 100;
- int row = c + b;
- int col = c + a;
- for (int i = 1; i <= row; i++)
- {
- for (int j = 1; j <= col; j++)
- {
- if ((N % 3 == 0) && (N % 5 == 0)) N = N - c;
- else if (N % 3 == 0) N = N - b;
- else if (N % 5 == 0) N = N - c;
- else N = N + a;
- Console.Write(N + " ");
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement