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 }


相关文章:

  • 2021-04-29
  • 2021-04-11
  • 2021-09-02
  • 2022-01-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-03-08
  • 2021-08-05
  • 2021-12-03
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案