Advertisement
Guest User

Untitled

a guest
Dec 8th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3.  
  4. using namespace std;
  5.  
  6. double Potega(double x,int n)
  7. {
  8. double p=1.0;
  9. for(int i=1;i<=n;i++)
  10. {
  11. p*=x;
  12. }
  13. return p;
  14. }
  15.  
  16. double PotegaR(double x, double y)
  17. {
  18. return exp(y*log(x));
  19. }
  20.  
  21. int main()
  22. {
  23. double a;
  24. double w;
  25. cin>>a;
  26. cin>>w;
  27. double wyn;
  28. wyn=Potega(a,w);
  29. cout<<wyn<<" ";
  30. double wynR;
  31. wynR=PotegaR(a,w);
  32. cout<<wynR;
  33. return 0;
  34. }
  35.  
  36.  
  37. ----------------
  38.  
  39.  
  40. #include <iostream>
  41.  
  42. using namespace std;
  43.  
  44. long long int silnia(int z)
  45. {
  46. long long int wynik=1;
  47. for(int i=1;i<=z;i++)
  48. {
  49. wynik*=i;
  50. cout<<i<<" "<<wynik<<endl;
  51. }
  52. }
  53.  
  54. int main()
  55. {
  56. int n;
  57. cin>>n;
  58. silnia(n);
  59. return 0;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement