1 #include <iostream>
2 using namespace std;
3
4 int main()
5 {
6 long base = 0;
7 long potenz = 0;
8 long wert = 1;
9
10 cout << "Geben Sie die BASE-Nummer(Ganze Zahl):" << endl;
11 cin >> base;
12 cout << "Geben Sie die POTENZ-Nummer(Ganze Zahl): " << endl;
13 cin >> potenz;
14
15 if (potenz == 0){
16 wert = 1;
17 cout << "Der Wert ist: " << wert << endl;
18 } else if (potenz == 1){
19 wert = base;
20 cout << "Der Wert ist: " << wert << endl;
21 } else if (potenz > 0){
22 for (; potenz >0; potenz--){
23 wert *= base;
24 }
25 cout << "Der Wert ist: " << wert << endl;
26 } else if (potenz < 0){
27 for (; potenz < 0; potenz++){
28 wert *= base;
29 }
30 cout << "Der Wert ist: 1/" << wert << endl;
31 }
32 return 0;
33 }