Created
June 14, 2010 06:38
-
-
Save thinkphp/437348 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream.h> | |
class dublet | |
{ | |
public: int i;int j; | |
dublet(int n=1;int m=1){ | |
i=n; | |
j=m; | |
} | |
int operator *(dublet a){ return a.i;} | |
int operator *(dublet a,dublet b){ return a.i*b.i+a.j*b.j;} | |
int operator +(dublet a,dublet b){ return a.i+a.j+b.i+b.j;} | |
}; | |
void main(){ | |
dublet x(4,5),y(3,7); | |
cout<<2+*x+x+y<<"\n"; | |
cout<<*x*y<<"\n"; | |
cout<<*x+y; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment