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 int a;
- static void Main(string[] args)
- {
- int sizeOfTheField;
- sizeOfTheField = int.Parse(Console.ReadLine());
- int radiusOfTheDisk;
- char point = '.';
- char star = '*';
- int center = sizeOfTheField / 2;
- radiusOfTheDisk = int.Parse(Console.ReadLine());
- for (int j = 0; j < sizeOfTheField; j++)
- {
- for (int i = 0; i < sizeOfTheField; i++)
- {
- double distance = Math.Sqrt(Math.Pow(center - i, 2) + Math.Pow(center - j, 2));
- if (distance <= radiusOfTheDisk)
- {
- Console.Write(star);
- }
- else
- {
- Console.Write(point);
- }
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment