Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp3
- {
- class Program
- {
- class Rectan
- {
- private int a, b;
- public Rectan (int a1, int b1)
- {
- a = a1; b = b1;
- }
- public void Rectan1()
- {
- a = 0; b = 0;
- }
- public int Rectan2
- {
- set
- {
- a = value;b = value;
- }
- }
- public int Area
- {
- get
- {
- return a * b;
- }
- }
- }
- static void Main(string[] args)
- {
- Rectan R1 = new Rectan(3,5);
- int k = int.Parse(Console.ReadLine());
- int k1 = int.Parse(Console.ReadLine());
- Rectan R2 = new Rectan(k, k1);
- Rectan R3 = new Rectan(4, 6);
- Console.WriteLine("S1 = " + R1.Area);
- Console.WriteLine("S2 = " + R2.Area);
- Console.WriteLine("S3 = " + R3.Area);
- int S1 = R1.Area;
- int S2 = R2.Area;
- int S3 = R3.Area;
- if (S1 > S2 && S1 > S3) Console.WriteLine("Max Area is: " + S1);
- else if (S2 > S3) Console.WriteLine("Max Area is: " + S2);
- else Console.WriteLine("Max Area is: " + S3);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement