Public paste
Undefined
By: calc | Date: Oct 6 2009 15:41 | Format: C++ | Expires: never | Size: 1.73 KB | Hits: 799

  1. #inc lude <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main ()
  6. {
  7. Schleife1:
  8. int zeichen;
  9. cout << " " << endl;
  10. cout << "JOES TASCHENRECHNER GT3000 LOWBOB EDITION" << endl;
  11. cout << "Built 06.10.09" << endl;
  12. cout << " " << endl;
  13. cout << "ntRechenarten:";
  14. cout << "nt------------------------";
  15. cout << "nt(1) Addition (a+b)";
  16. cout << "nt(2) Subtraktion (a-b)";
  17. cout << "nt(3) Multiplikation (a*b)";
  18. cout << "nt(4) Division (a/b)";
  19. cout << "nt ";
  20. cout << "nt(5) Potenzrechnung (a^b)";
  21. cout << "nt(6) Prozentrechnung (a/100*b)";
  22. cout << "nt------------------------";
  23. cout << " " << endl;
  24. cout << " " << endl;
  25. cout << " " << endl;
  26. cout << "Deine Auswahl: ";
  27. cin >> zeichen;
  28.  
  29. if ((zeichen >= 1) && (zeichen <=6))
  30. {
  31. cout << " " << endl;
  32.  
  33. Zahl1:
  34. int eins;
  35. cout << "Erste Zahl: ";
  36. cin >> eins;
  37. cout << " " << endl;
  38.  
  39. if (eins>=1)
  40. {
  41. Zahl2:
  42. int zwei;
  43. cout << "Zweite Zahl: ";
  44. cin >> zwei;
  45. cout << " " << endl;
  46.  
  47. if (zwei>=1)
  48. {
  49.  
  50. int ergebnis;
  51.  
  52. if (zeichen==1)
  53. {
  54. ergebnis = eins+zwei;
  55. cout << eins << " + " << zwei << " = " << ergebnis << endl;
  56. }
  57. if (zeichen==2)
  58. {
  59. ergebnis = eins-zwei;
  60. cout << eins << " - " << zwei << " = " << ergebnis << endl;
  61. }
  62. if (zeichen==3)
  63. {
  64. ergebnis = eins*zwei;
  65. cout << eins << " * " << zwei << " = " << ergebnis << endl;
  66. }
  67. if (zeichen==4)
  68. {
  69. ergebnis = eins/zwei;
  70. cout << eins << " / " << zwei << " = " << ergebnis << endl;
  71. }
  72. if (zeichen==5)
  73. {
  74. ergebnis = pow(eins, zwei)
  75. cout << eins << " ^ " << zwei << " = " << ergebnis << endl;
  76. }
  77. if (zeichen==6)
  78. {
  79. ergebnis = eins/100*zwei;
  80. cout << eins << " / " << "100 " << " * " << zwei << " = " << ergebnis << endl;
  81. }
  82.  
  83.  
  84.  
  85. }
  86. else goto Zahl2;
  87. }
  88. else goto Zahl1;
  89. }
  90. else goto Schleife1;
  91.  
  92. system ("pause");
  93. }