Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.53 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ekz
  4. {
  5.     enum Color {Blue, White, Red, Black, Green }
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             Planet mars = new Planet();
  11.             Planet earth = new Planet();
  12.             Planet Jupiter = new Planet();
  13.             mars.Radius = 10;
  14.             earth.Radius = 15;
  15.             Jupiter.Radius = 20;
  16.             int[] rad = { mars.Radius, earth.Radius, Jupiter.Radius };
  17.             int max = rad[0];
  18.  
  19.             int min = rad[0];
  20.             foreach(int value in rad)
  21.             {
  22.                 if (value < min)
  23.                     min = value;
  24.                 if (value > max)
  25.                     max = value;
  26.  
  27.             }
  28.             Console.WriteLine("радиус самой большой планеты: " + max);
  29.             Console.ReadLine();
  30.         }
  31.     }
  32.  
  33.  
  34.  
  35.     class Planet
  36.     {
  37.         int x;
  38.         int y;
  39.         int z;
  40.         int angle;
  41.         int radius;
  42.  
  43.         public int X { get; set; }
  44.         public int Y { get; set; }
  45.         public int Z { get; set; }
  46.         public int Angle { get; set; }
  47.  
  48.         public int Radius { get; set; }
  49.  
  50.         public virtual int Rotate(int a)
  51.         {
  52.            
  53.             a = Angle + 1 ;
  54.             return a;
  55.         }
  56.     }
  57.  
  58.  
  59.     class Earth : Planet
  60.     {
  61.        
  62.  
  63.        
  64.     }
  65.  
  66.     class Mars : Planet
  67.     {
  68.         public override int Rotate(int a)
  69.         {
  70.             a = Angle + 3;
  71.             return base.Rotate(a);
  72.         }
  73.     }
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement