Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- #include "Numero.h"
- int main (void)
- {
- int n,d,n1,d2;
- cout<<"a.Numerador";
- cin >>n;
- cout <<"a.Denominador";
- cin >>d;
- cout <<"b.Numerador";
- cin >>n1;
- cout >>"b.Denominador";
- cin >> d1;
- numero a(n,d),b(n1,d1),c;
- c=a+b;
- a.ToPrint();
- cout << "+";
- b.Toprint();
- cout <<"=";
- c=a+b;
- c.To.Print();
- cout <<endl;
- c=a*b;
- c.ToPrint();
- cout <<endl;
- return 0;
- }
- /*el de el pdf
- /*
- Programa: Numero.cpp
- Autor: Carlos Bernardo Garza Treviño
- Fecha: 02/02/12
- */
- #include <iostream>
- using namespace std;
- #include "Numero.h"
- int main( void )
- {
- int n, d, n1, d1;
- cout << "a.Numerador ";
- cin >> n;
- cout << "a.Denominador ";
- cin >> d;
- cout << "b.Numerador ";
- cin >> n1;
- cout << "b.Denominador ";
- cin >> d1;
- Numero a(n,d), b(n1,d1), c;
- a.ToPrint();
- cout << " + ";
- b.ToPrint();
- cout << " = ";
- c = a + b;
- c.ToPrint();
- cout << endl;
- c = a * b;
- c.ToPrint();
- cout << endl;
- return 0;
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement