alduncin

._. cpp

Feb 12th, 2012
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. /*
  2. Programa: Numero.cpp
  3.  
  4. Fecha: 02/02/12
  5. */
  6. #include <iostream>
  7.  
  8. using namespace std;
  9.  
  10. #include "Numero.h"
  11. int main( void )
  12. {
  13. int n, d, n1, d1;
  14. cout << "a.Numerador ";
  15. cin >> n;
  16. cout << "a.Denominador ";
  17. cin >> d;
  18. cout << "b.Numerador ";
  19. cin >> n1;
  20. cout << "b.Denominador ";
  21. cin >> d1;
  22. Numero a(n,d), b(n1,d1), c;
  23.  
  24. a.ToPrint();
  25. cout << " ___ ";
  26. b.ToPrint();
  27. cout << endl;
  28. //suma
  29. cout << " = ";
  30. c = a + b;
  31. c.ToPrint();
  32. cout << endl;
  33. //multiplicacion
  34. cout << " = ";
  35. c = a * b;
  36. c.ToPrint();
  37. cout << endl;
  38. /*
  39. //division
  40. cout <<" = ";
  41. c= a/b;
  42. c.ToPrint();
  43. cout << endl;
  44. //resta
  45. cout <<" = ";
  46. c=a-b;
  47. c.ToPrint();
  48. cout<<endl;
  49. */
  50. system("pause");
  51. return 0;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment