Statistics
Total online: 1 Guests: 1 Users: 0
|
Main » 2011 » June » 16
#include <iostream>
using namespace std;
class Int{ int i; public: Int(int a){i=a;} friend int operator + (Int&, Int&); friend int operator * (Int&, Int&); friend int operator % (Int&, Int&); }; int operator + (Int& a, Int& b){return a.i*b.i-a.i;}; int operator * (Int& a, Int& b){return a.i-b.i;}; int operator % (Int& a, Int& b){return (100*b.i)/a.i;};
int main() { int x,y; cin>>x>>y; Int a(x),b(y); cout<<endl<<a*b+(a+b)<<endl<<a%b; return 0; }
| |
|