SHOW:
|
|
- or go back to the newest paste.
1 | using System; | |
2 | using System.Collections.Generic; | |
3 | using System.Linq; | |
4 | using System.Text; | |
5 | ||
6 | namespace ConsoleApplication1 | |
7 | { | |
8 | class Program | |
9 | { | |
10 | static void Main(string[] args) | |
11 | { | |
12 | } | |
13 | } | |
14 | } | |
15 | class polynomial | |
16 | { public polynomial() | |
17 | public override string ToString() | |
18 | { | |
19 | string s = .ToString(); | |
20 | return ; | |
21 | } | |
22 | public static polynomial operator -(polynomial , polynomial) | |
23 | { | |
24 | return new polynomial( - ); | |
25 | } | |
26 | - | publicreadonlyint x, y; |
26 | + | public readonly int x, y; |
27 | ||
28 | public TwoDPoint(int x, int y) //constructor | |
29 | { | |
30 | this.x = x; | |
31 | this.y = y; | |
32 | } | |
33 | ||
34 | - | publicoverridebool Equals(System.Object obj) |
34 | + | public override bool Equals(System.Object obj) |
35 | { | |
36 | if (obj == null) | |
37 | { | |
38 | - | returnfalse; |
38 | + | return false; |
39 | } | |
40 | ||
41 | TwoDPoint p = obj as TwoDPoint; | |
42 | if ((System.Object)p == null) | |
43 | { | |
44 | - | returnfalse; |
44 | + | return false; |
45 | } | |
46 | ||
47 | return (x == p.x) && (y == p.y); | |
48 | } | |
49 | ||
50 | - | publicbool Equals(TwoDPoint p) |
50 | + | public bool Equals(TwoDPoint p) |
51 | { | |
52 | if ((object)p == null) | |
53 | { | |
54 | - | returnfalse; |
54 | + | return false; |
55 | } | |
56 | ||
57 | return (x == p.x) && (y == p.y); | |
58 | } | |
59 | ||
60 | - | publicoverrideint GetHashCode() |
60 | + | public override int GetHashCode() |
61 | { | |
62 | return ; | |
63 | } | |
64 | } | |
65 | ||
66 | } | |
67 | } |