Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp1
- {
- public class Bod2D
- {
- public int x { get; set; }
- public int y { get; set; }
- public override string ToString()
- {
- return $"x={x} y={y}";
- }
- public Bod2D(int x, int y)
- {
- this.x = x;
- this.y = y;
- }
- }
- public class Kruh
- {
- public Bod2D bod { get; set; }
- public int r { get; set; }
- public Kruh(Bod2D bod, int r)
- {
- this.bod = bod;
- this.r = r;
- }
- public double V { get; set; }
- public void VratObvod()
- {
- double V = 2 * Math.PI * r;
- bod.x = 5;
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- Bod2D bod = new Bod2D(2, 3);
- Kruh kruh = new Kruh(bod, 10);
- //Console.WriteLine(kruh.bod.x + " " +kruh.bod.y);
- kruh.VratObvod();
- Console.WriteLine(kruh.V);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement