Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- double Potega(double x,int n)
- {
- double p=1.0;
- for(int i=1;i<=n;i++)
- {
- p*=x;
- }
- return p;
- }
- double PotegaR(double x, double y)
- {
- return exp(y*log(x));
- }
- int main()
- {
- double a;
- double w;
- cin>>a;
- cin>>w;
- double wyn;
- wyn=Potega(a,w);
- cout<<wyn<<" ";
- double wynR;
- wynR=PotegaR(a,w);
- cout<<wynR;
- return 0;
- }
- ----------------
- #include <iostream>
- using namespace std;
- long long int silnia(int z)
- {
- long long int wynik=1;
- for(int i=1;i<=z;i++)
- {
- wynik*=i;
- cout<<i<<" "<<wynik<<endl;
- }
- }
- int main()
- {
- int n;
- cin>>n;
- silnia(n);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement