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;
- namespace novo2
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int r = int.Parse(Console.ReadLine());
- int center = n / 2;
- for (int i = 0; i < n; i++)
- {
- for (int j = 0; j < n; j++)
- {
- int x = center - i;
- int y = center - j;
- double distance = Math.Sqrt(Math.Pow(x, 2) + Math.Pow(y, 2));
- if (distance <= r)
- {
- Console.Write("*");
- }
- else
- {
- Console.Write(".");
- }
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment