Calendar
« June 2011 » |
Su |
Mo |
Tu |
We |
Th |
Fr |
Sa |
| | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
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; }
| |
|