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 ConsoleApp1
- {
- class sprzety
- {
- public float wartoscSprzetow;
- public sprzety()
- {
- }
- public sprzety(float wartoscSprzetow)
- {
- this.wartoscSprzetow = wartoscSprzetow;
- }
- public static sprzety operator +(sprzety sprzet1, sprzety sprzet2)
- {
- return new sprzety(sprzet1.wartoscSprzetow + sprzet2.wartoscSprzetow);
- }
- public static bool operator >(sprzety sprzet1, sprzety sprzet2)
- {
- if (sprzet1.wartoscSprzetow > sprzet2.wartoscSprzetow)
- return true;
- else
- return false;
- }
- public static bool operator <(sprzety sprzet1, sprzety sprzet2)
- {
- if (sprzet1.wartoscSprzetow < sprzet2.wartoscSprzetow)
- return true;
- else
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement