Advertisement
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.Tasks;
- namespace IP_L01_P2
- {
- class A
- {
- public void M1()
- {
- Console.WriteLine("M1");
- }
- public void M2()
- {
- Console.WriteLine("M2");
- }
- public void M3(int n)
- {
- Console.WriteLine(n);
- }
- public void M4(string n)
- {
- Console.WriteLine(n);
- }
- }
- class B
- {
- public int suma(int n)
- {
- return n + 11;
- }
- public int diferenta(int n, int x)
- {
- return n - x - 2;
- }
- public int inmultire(int n)
- {
- return n * 4;
- }
- public int impartire(int n)
- {
- return n / 5;
- }
- }
- class C
- {
- public int suma(int n)
- {
- return n + 5;
- }
- public int diferenta(int n, int x)
- {
- return n - x * 2;
- }
- public int inmultire(int n)
- {
- return n * 5;
- }
- public int impartire(int n)
- {
- return n / 24;
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- A a = new A();
- a.M1();
- a.M2();
- a.M3(2);
- a.M4("ana are mere");
- B b = new B();
- Console.WriteLine(b.suma(3));
- Console.WriteLine(b.diferenta(2, 4));
- Console.WriteLine(b.impartire(4));
- C c = new C();
- Console.WriteLine(c.suma(3));
- Console.WriteLine(c.diferenta(2, 4));
- Console.WriteLine(c.impartire(4));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement