fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Exponential
  5. {
  6. int basis, exp;
  7. Exponential(int b = 1, int e = 1): basis{b}, exp{e} {
  8. if(b==0 && e==0) {
  9. throw runtime_error("");
  10. }
  11. if(b==0 && e>=0) {
  12. cout << "0^1" << endl;
  13. }
  14. if(b==0 && e<0) {
  15. cout << "0^-1" << endl;
  16. }
  17. if(b==1) {
  18. cout << "1^0";
  19. }
  20. if(b!=0 && e==0) {
  21. int ausgabe = 1;
  22. }
  23.  
  24. }
  25. };
  26.  
  27. int main()
  28. {
  29. Exponential(1,1);
  30. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
1^0