Thursday, 18.04.2024, 13:04
Welcome Guest | RSS
Site menu
Login form
Section categories
Search
Calendar
«  June 2011  »
SuMoTuWeThFrSa
   1234
567891011
12131415161718
19202122232425
2627282930
Entries archive
Our poll
Rate my site
Total of answers: 6
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;
}

Category: C++ programs | Views: 540 | Added by: H_Imirzyan | Date: 16.06.2011 | Comments (0)