Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ekz
- {
- enum Color {Blue, White, Red, Black, Green }
- class Program
- {
- static void Main(string[] args)
- {
- Planet mars = new Planet();
- Planet earth = new Planet();
- Planet Jupiter = new Planet();
- mars.Radius = 10;
- earth.Radius = 15;
- Jupiter.Radius = 20;
- int[] rad = { mars.Radius, earth.Radius, Jupiter.Radius };
- int max = rad[0];
- int min = rad[0];
- foreach(int value in rad)
- {
- if (value < min)
- min = value;
- if (value > max)
- max = value;
- }
- Console.WriteLine("радиус самой большой планеты: " + max);
- Console.ReadLine();
- }
- }
- class Planet
- {
- int x;
- int y;
- int z;
- int angle;
- int radius;
- public int X { get; set; }
- public int Y { get; set; }
- public int Z { get; set; }
- public int Angle { get; set; }
- public int Radius { get; set; }
- public virtual int Rotate(int a)
- {
- a = Angle + 1 ;
- return a;
- }
- }
- class Earth : Planet
- {
- }
- class Mars : Planet
- {
- public override int Rotate(int a)
- {
- a = Angle + 3;
- return base.Rotate(a);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement