Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main(string[] args)
- {
- int N = int.Parse(Console.ReadLine());
- int left = N-1;
- int right = N-1;
- int center = N-1;
- for (int f = 1; f <= N; f++) {
- if (f == N) {
- for(int g = 1 ; g <= (2*N - 3); g++){
- if(g == center){
- Console.Write("*");
- }else{
- Console.Write(".");
- }
- }
- }
- else{
- for (int i = 1; i <= (2 * N - 3); i++) {
- if (i >= left && i <= right)
- {
- Console.Write("*");
- }
- else {
- Console.Write(".");
- }
- }
- left--;
- right++;
- Console.WriteLine();
- }
- }
- Console.WriteLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement