• Source
    1. #include <iostream>
    2. using namespace std;
    3.  
    4. int poteguj(int x, int y)
    5. {
    6. int z=1;
    7. while (y!=0)
    8. {
    9. z=z*x;
    10. y--;
    11. }
    12. return z;
    13. }
    14.  
    15. int main() {
    16. int x;
    17. int y;
    18. cin >> x;
    19. cout << endl;
    20. cin >> y;
    21. cout << endl << x << " do potegi " << y << "=" << poteguj (x,y) << endl;
    22. return 0;
    23. }
    24.