asmodeus94

potR

Jan 22nd, 2013
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. using namespace std;
  4. int x,y;
  5. int potR(int x,int y){
  6.     if (y==0) return 1; else return potR(x,y-1)*x;
  7. }
  8. int main(){
  9. cin>>x;
  10. cin>>y;
  11. cout<<potR(x,y);
  12. getchar();getchar();
  13. }
Advertisement
Add Comment
Please, Sign In to add comment